Skip to content

Commit

Permalink
celery once setting
Browse files Browse the repository at this point in the history
  • Loading branch information
snyaggarwal committed Feb 23, 2021
1 parent 23e965d commit 6079f02
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/celery.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "core.settings")
app = Celery('core')

app.conf.ONCE = settings.CELERY_ONCE # force CELERY_ONCE to load settings
app.config_from_object('django.conf:settings', namespace='CELERY')
app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)
7 changes: 6 additions & 1 deletion core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,12 @@
CELERY_BROKER_CONNECTION_TIMEOUT = 10.0
CELERY_BROKER_TRANSPORT_OPTIONS = {'visibility_timeout': 259200} #72 hours, the lon
CELERY_ACCEPT_CONTENT = ['application/json']

CELERY_ONCE = {
'backend': 'celery_once.backends.Redis',
'settings': {
'url': CELERY_RESULT_BACKEND,
}
}
ELASTICSEARCH_DSL_PARALLEL = True
ELASTICSEARCH_DSL_AUTO_REFRESH = True
ELASTICSEARCH_DSL_AUTOSYNC = True
Expand Down

0 comments on commit 6079f02

Please sign in to comment.