Skip to content

Commit

Permalink
Merge pull request #1432 from uwcirg/bug/celery-backend
Browse files Browse the repository at this point in the history
Configure redis backend from existing values
  • Loading branch information
ivan-c authored Sep 28, 2017
2 parents 1cc9b3b + 1ec01e0 commit 7b452a5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions portal/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ class BaseConfig(object):
'CELERY_BROKER_URL',
REDIS_URL
)
CELERY_RESULT_BACKEND = os.environ.get(
'CELERY_RESULT_BACKEND',
REDIS_URL
)
REQUEST_CACHE_URL = os.environ.get(
'REQUEST_CACHE_URL',
REDIS_URL
Expand Down
6 changes: 4 additions & 2 deletions portal/factories/celery.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ def create_celery(app):
global __celery
if __celery:
return __celery

celery = Celery(
app.import_name,
broker=app.config['CELERY_BROKER_URL']
backend=app.config['CELERY_RESULT_BACKEND'],
broker=app.config['CELERY_BROKER_URL'],
)
celery.conf.update(app.config)
TaskBase = celery.Task

TaskBase = celery.Task
class ContextTask(TaskBase):
abstract = True

Expand Down

0 comments on commit 7b452a5

Please sign in to comment.