Commit d5e01e75 authored by lixiaofang's avatar lixiaofang

add

parent 7f9142bb
from django.shortcuts import render
# Create your views here.
from injection.data_sync.tasks import sync_face_similar_data_to_redis
def post(request):
result = sync_face_similar_data_to_redis()
......@@ -4,5 +4,5 @@ import pymysql
from _celery import app as celery_app
pymysql.install_as_MySQLdb()
__all__ = ('celery_app',)
# __all__ = ('celery_app',)
......@@ -22,23 +22,3 @@ app.conf.broker_url = settings.CELERY_BROKER_URL
@app.task(bind=True)
def debug_task(self):
print('Request: {0!r}'.format(self.request))
from celery.schedules import crontab
app.conf.update(
CELERYBEAT_SCHEDULE = {
'sum-task': {
'task': 'deploy.tasks.add',
'schedule': crontab(hour=1),
'args': (5, 6)
},
'send-report': {
'task': 'deploy.tasks.report',
'schedule': crontab(hour=4, minute=30, day_of_week=1),
}
}
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment