redis broker and backend
This commit is contained in:
parent
b5870cf12d
commit
40eb9c3ad2
|
|
@ -1,8 +1,2 @@
|
||||||
# Create your tasks here
|
# Create your tasks here
|
||||||
|
|
||||||
from celery import shared_task
|
|
||||||
|
|
||||||
|
|
||||||
@shared_task
|
|
||||||
def add(x, y):
|
|
||||||
return x + y
|
|
||||||
|
|
@ -35,15 +35,9 @@ app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)
|
||||||
|
|
||||||
|
|
||||||
@app.task(bind=True)
|
@app.task(bind=True)
|
||||||
def debug_task(self):
|
|
||||||
print(f'Request: {self.request}')
|
|
||||||
|
|
||||||
|
|
||||||
@app.task
|
|
||||||
def add(x, y):
|
def add(x, y):
|
||||||
return x + y
|
return x + y
|
||||||
|
|
||||||
|
|
||||||
@app.task
|
@app.task
|
||||||
def my_task():
|
def add2(x, y):
|
||||||
print(connection.schema_name)
|
return x + y
|
||||||
|
|
|
||||||
|
|
@ -217,8 +217,8 @@ CELERY_TIMEZONE=os.environ.get('TIME_ZONE', 'UTC')
|
||||||
CELERY_TASK_TRACK_STARTED=True
|
CELERY_TASK_TRACK_STARTED=True
|
||||||
CELERY_TASK_TIME_LIMIT=30 * 60
|
CELERY_TASK_TIME_LIMIT=30 * 60
|
||||||
BROKER_URL=os.environ.get('CELERY_BROKER')
|
BROKER_URL=os.environ.get('CELERY_BROKER')
|
||||||
# CELERY_BROKER=os.environ.get('CELERY_BROKER')
|
RESULT_BACKEND=os.environ.get('CELERY_BROKER')
|
||||||
# CELERY_BROKER_URL=os.environ.get('CELERY_BROKER')
|
CELERY_RESULT_BACKEND=os.environ.get('CELERY_BACKEND')
|
||||||
# DJANGO_CELERY_BEAT_TZ_AWARE=False
|
# DJANGO_CELERY_BEAT_TZ_AWARE=False
|
||||||
# celery -A TiBillet worker -l INFO
|
# celery -A TiBillet worker -l INFO
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue