summaryrefslogtreecommitdiff
path: root/tasks.py
diff options
context:
space:
mode:
authorYuval Adam <yuv.adm@gmail.com>2013-11-20 13:09:00 +0200
committerYuval Adam <yuv.adm@gmail.com>2013-11-20 13:11:56 +0200
commit94ad7c9f133d30d9bec3f217c93d3d959943d773 (patch)
treed146a9402e24f89ba18d0b84babf19db791723e4 /tasks.py
parent9ed9743224e9c95f492404ec0eb9d5b748ffd34f (diff)
Bump to Celery 3.1.4
Add configuration changes that disable pickle as an accepted serializer Use the json serializer by default Required before bumping to Celery 3.2
Diffstat (limited to 'tasks.py')
-rw-r--r--tasks.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/tasks.py b/tasks.py
index c08c357..fa6b143 100644
--- a/tasks.py
+++ b/tasks.py
@@ -9,7 +9,14 @@ from os import environ
REDIS_URL = environ.get('REDISTOGO_URL', 'redis://localhost')
# Setup the celery instance under the 'tasks' namespace
-celery = Celery('tasks', broker=REDIS_URL)
+app = Celery('tasks')
+
+# Use Redis as our broker and define json as the default serializer
+app.conf.update(
+ BROKER_URL=REDIS_URL,
+ CELERY_TASK_SERIALIZER='json',
+ CELERY_ACCEPT_CONTENT=['json', 'msgpack', 'yaml']
+)
# Define the fibonacci function for use in our task
def fib(n):