added tasks

This commit is contained in:
Marvin Zhang
2019-02-18 21:16:40 +08:00
parent 06575c8ae5
commit a4a0fdd67b
6 changed files with 52 additions and 9 deletions

View File

@@ -1,9 +1,17 @@
import os
import sys
import threading
from celery import Celery
app = Celery(__name__)
app.config_from_object('config.celery')
import tasks.spider
import tasks.deploy
if __name__ == '__main__':
app.start(argv=['tasks.spider', 'worker', '-P', 'eventlet', '-E', '-l', 'INFO'])
if sys.platform == 'windows':
app.start(argv=['tasks', 'worker', '-P', 'eventlet', '-E', '-l', 'INFO'])
else:
app.start(argv=['tasks', 'worker', '-E', '-l', 'INFO'])