Created
March 17, 2015 12:51
-
-
Save GameXG/21763336458d417a60ad to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
# utf-8 中文编码 | |
from celery import Celery | |
app = Celery('tasks', backend='redis://localhost', broker='redis://localhost') | |
app.conf.CELERY_TASK_SERIALIZER = 'json' | |
app.conf.CELERY_IGNORE_RESULT = False | |
app.conf.CELERY_ACCEPT_CONTENT = ["json"] | |
app.conf.CELERY_RESULT_SERIALIZER = 'json' | |
app.conf.CELERY_TRACK_STARTED = True | |
@app.task(ignore_result = False) | |
def add(x, y): | |
return x + y | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment