-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
71 lines (60 loc) · 1.84 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
61
62
63
64
65
66
67
68
from __future__ import absolute_import
from pytz import timezone
from celery.schedules import crontab
# Celery Config File
## Broker settings.
BROKER_URL = 'amqp://guest:guest@localhost:5672//'
# List of modules to import when celery starts.
CELERY_IMPORTS = ('Task_Manager.DataGather.Data_func', 'IP_update.IP_Email',)
## Using the database to store task state and results.
CELERY_RESULT_BACKEND = 'rpc://'
CELERY_RESULT_PERSISTENT = True
#Use Eastern Timezone
CELERY_TIMEZONE = timezone('US/Eastern').zone
#Celery Beat Scheduler
CELERYBEAT_SCHEDULE = {
'Query-Yahoo':{
'task':'Task_Manager.DataGather.Data_func.post_daily_collection',
'schedule': crontab(
hour='9-16',
day_of_week='mon-fri'
),
'args': ("stox",), # Have to determine DB name
},
'Update-History':{
'task':'Task_Manager.DataGather.Data_func.update_Historical_table',
'schedule': crontab(
hour='9-16',
day_of_week='mon-fri',
minute='*/5',
),
'args': ("stox",), # Have to determine DB name
},
'Update Stock Table':{
'task':'Task_Manager.DataGather.Data_func.update_stock_table',
'schedule': crontab(
hour='9-16',
day_of_week='mon-fri'
),
'args': ("stox",), # Have to determine DB name
},
'Clear Daily Table':{
'task':'Data_func.clear_daily_collection',
'schedule': crontab(
day_of_week='mon-fri',
minute='0',
hour='9',
),
'args': ("stox",), # Have to determine DB name
},
'IP_EMAIL':{
'task':'IP_update.IP_Email.Email_or_No_email',
'schedule': crontab(
minute='*/30',
hour='*',
),
# Have to determine DB name
},
}
# Error Emails
CELERY_SEND_TASK_ERROR_EMAILS = False