Skip to content

Instantly share code, notes, and snippets.

@GameXG
Created March 17, 2015 12:51
Show Gist options
  • Save GameXG/21763336458d417a60ad to your computer and use it in GitHub Desktop.
Save GameXG/21763336458d417a60ad to your computer and use it in GitHub Desktop.
#!/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