-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
60 lines (56 loc) · 2.21 KB
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
class Config(object):
from datetime import timedelta
SECRET_KEY = 'OVERRIDE THIS WITH A SECURE VALUE in instance/config.py!'
CELERY_BROKER_URL = 'redis://'
CELERY_RESULT_BACKEND = 'redis://'
CELERY_ACCEPT_CONTENT = ['pickle']
CELERYBEAT_SCHEDULE = {
'update-agencies-every-week': {
'task': 'celerytasks.update_agencies',
'schedule': timedelta(days=7),
},
'update-routes-every-24h': {
'task': 'celerytasks.update_routes',
'schedule': timedelta(hours=24),
},
'update-predictions-every-9s': {
'task': 'celerytasks.update_predictions',
'schedule': timedelta(seconds=9),
},
'update-vehicle-locations-every-3s': {
'task': 'celerytasks.update_vehicle_locations',
'schedule': timedelta(seconds=3),
},
'delete-stale-predictions-every-5m': {
'task': 'celerytasks.delete_stale_predictions',
'schedule': timedelta(minutes=5),
},
'delete-stale-vehicle-locations-every-5m': {
'task': 'celerytasks.delete_stale_vehicle_locations',
'schedule': timedelta(minutes=5),
},
}
SQLALCHEMY_TRACK_MODIFICATIONS = False
PREDICTIONS_MAX_AGE = 5 * 60;
LOCATIONS_MAX_AGE = 5 * 60;
AGENCIES = ['rutgers']
# Stops with the same tag within this distance of each other will be averaged to one lat/lon point.
# 0.001 = 110 Meters (football field)
SAME_STOP_LAT = 0.005
SAME_STOP_LON = 0.005
# Map display parameters
MAP_ERROR_TILE_URL = 'http://tiles.antsar-static.com/generic/tile-blank-black.png'
MAP_TILE_URL = 'http://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png'
MAP_TILE_SUBDOMAINS = ['a', 'b', 'c']
MAP_TILESET = 'rutgers-black'
MAP_LAT_PADDING = 0.03
MAP_LON_PADDING = 0.03
class ProdConfig(Config):
SQLALCHEMY_URI = 'postgresql://localhost/pybusmap_prod'
CELERY_BROKER_URL = 'redis://localhost/0'
CELERY_RESULT_BACKEND = 'redis://localhost/0'
class DevConfig(Config):
DEBUG = True
SQLALCHEMY_URI = 'postgresql://localhost/pybusmap_dev'
CELERY_BROKER_URL = 'redis://localhost/1'
CELERY_RESULT_BACKEND = 'redis://localhost/1'