Skip to content

Commit

Permalink
Merge pull request #754 from WorldBank-Transport/feature/group_var_de…
Browse files Browse the repository at this point in the history
…dup_settings

Allow customizing deduplication configuration variables from group_vars
  • Loading branch information
rmartz authored Feb 1, 2019
2 parents f9c8a0c + be1ece6 commit 80667cd
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/driver/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,9 @@
CELERY_EXPORTS_FILE_PATH = '/var/www/media'

# Deduplication settings
DEDUPE_TIME_RANGE_HOURS = 12
DEDUPE_TIME_RANGE_HOURS = float(os.environ.get('DRIVER_DEDUPE_TIME_RANGE_HOURS', '12'))
# .001 ~= 110m
DEDUPE_DISTANCE_DEGREES = 0.0008
DEDUPE_DISTANCE_DEGREES = float(os.environ.get('DRIVER_DEDUPE_DISTANCE_DEGREES', '0.0008'))

GROUT = {
# It is suggested to change this if you know that your data will be limited to
Expand Down
4 changes: 4 additions & 0 deletions deployment/ansible/group_vars/development
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ driver_admin_username: "admin"
driver_admin_password: "admin"
driver_admin_email: "[email protected]"

## DEDUPLICATION SETTINGS
dedupe_time_range_hours: "12"
dedupe_distance_degrees: "0.0008"

## WEB SETTINGS
js_html5mode: "false"
js_html5mode_prefix: "!"
Expand Down
4 changes: 4 additions & 0 deletions deployment/ansible/group_vars/production.example
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ driver_admin_username: "admin"
#driver_admin_password: "uncomment and change me!"
driver_admin_email: "[email protected]"

## DEDUPLICATION SETTINGS
dedupe_time_range_hours: "12"
dedupe_distance_degrees: "0.0008"

## WEB SETTINGS
# DRIVER uses the PickPoint API (which runs Nominatim) for geocoding; this is the API key that
# should be used when accessing that API. You can sign up for an API key here:
Expand Down
4 changes: 4 additions & 0 deletions deployment/ansible/group_vars/production.j2
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ driver_admin_username: "admin"
driver_admin_password: "{{ driver_admin_password }}"
driver_admin_email: "[email protected]"

## DEDUPLICATION SETTINGS
dedupe_time_range_hours: "12"
dedupe_distance_degrees: "0.0008"

## WEB SETTINGS
# DRIVER uses the PickPoint API (which runs Nominatim) for geocoding; this is the API key that
# should be used when accessing that API. You can sign up for an API key here:
Expand Down
4 changes: 4 additions & 0 deletions deployment/ansible/group_vars/staging
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ driver_admin_username: "admin"
driver_admin_password: "admin"
driver_admin_email: "[email protected]"

## DEDUPLICATION SETTINGS
dedupe_time_range_hours: "12"
dedupe_distance_degrees: "0.0008"

## WEB SETTINGS
js_html5mode: "false"
js_html5mode_prefix: "!"
Expand Down
2 changes: 2 additions & 0 deletions deployment/ansible/roles/driver.app/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ driver_conf:
DJANGO_ENV: "{% if developing %}development{% elif staging %}staging{% else %}production{% endif %}"
DRIVER_OSM_EXTRACT_URL: "{{ osm_extract_url }}"
ALLOWED_HOST: "{{ allowed_host }}"
DRIVER_DEDUPE_TIME_RANGE_HOURS: "{{ dedupe_time_range_hours }}"
DRIVER_DEDUPE_DISTANCE_DEGREES: "{{ dedupe_distance_degrees }}"

driver_postgis_version: 2.1.3

Expand Down

0 comments on commit 80667cd

Please sign in to comment.