-
Notifications
You must be signed in to change notification settings - Fork 0
/
celeryconfig.py
44 lines (34 loc) · 1.12 KB
/
celeryconfig.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
__author__ = 'pyt'
import sys
import os
from datetime import timedelta
sys.path.insert(0, os.getcwd())
CELERY_SEND_EVENTS = True
CELERY_TASK_PUBLISH_RETRY = True
BROKER_HEARTBEAT = 30
BROKER_CONNECTION_RETRY = True
BROKER_CONNECTION_MAX_RETRIES = 100
BROKER_CONNECTION_TIMEOUT = 4
CELERY_CREATE_MISSING_QUEUES = True
BROKER_URL = "amqp://guest:@127.0.0.1//"
CELERY_IMPORTS = ("CeleryPaste.tasks.couchdb_tasks",
"CeleryPaste.tasks.download_tasks",
"CeleryPaste.tasks.grabers_tasks",
"CeleryPaste.tasks.redis_tasks",
"CeleryPaste.tasks.scraper"
)
CELERY_RESULT_BACKEND = "amqp://guest:@127.0.0.1//"
CELERY_TIMEZONE = 'UTC'
CELERY_ROUTES = {
'CeleryPaste.tasks.couchdb_tasks': {'queue': 'db'},
'CeleryPaste.tasks.download_tasks': {'queue': 'download'},
'CeleryPaste.tasks.grabers_tasks': {'queue': 'grabers'},
'CeleryPaste.tasks.redis_tasks': {'queue': 'db'},
}
CELERY_CREATE_MISSING_QUEUES = True
CELERYBEAT_SCHEDULE = {
'runs-every-1-minute': {
'task': 'CeleryPaste.tasks.scraper.worker',
'schedule': timedelta(minutes=1)
},
}