From 5ee0f705c3ab750a906ab498516aa91ddc2dbe94 Mon Sep 17 00:00:00 2001 From: xianfuxing Date: Mon, 13 Aug 2018 20:33:36 +0800 Subject: [PATCH] # up task redis --- apps/mosquito/tasks.py | 1 + mosqkiller/settings.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/mosquito/tasks.py b/apps/mosquito/tasks.py index 11dded8..90a3bf1 100644 --- a/apps/mosquito/tasks.py +++ b/apps/mosquito/tasks.py @@ -76,6 +76,7 @@ def update_daily_statistic(): history, created = MosqPostStatistic.objects.update_or_create(date=d, total=ret[d], increment=increment) is_first = False + @task() def update_latest_statistic(): pass \ No newline at end of file diff --git a/mosqkiller/settings.py b/mosqkiller/settings.py index 2c173c6..68885f3 100644 --- a/mosqkiller/settings.py +++ b/mosqkiller/settings.py @@ -201,7 +201,7 @@ CACHES = { } # Celery settings -CELERY_BROKER_URL = 'redis://127.0.0.1:6379/2' +CELERY_BROKER_URL = 'redis://:IySpkVL39NeOgyC@127.0.0.1:6379/2' CELERY_RESULT_BACKEND = 'django-db' CELERY_ACCEPT_CONTENT = ['json'] CELERY_TASK_SERIALIZER = 'json'