Skip to content

Commit

Permalink
Fix attempt related to celery/celery#4817
Browse files Browse the repository at this point in the history
  • Loading branch information
DEKHTIARJonathan committed Jul 22, 2018
1 parent 5f86506 commit e94a0a1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,4 @@ celeryev.pid
celerybeat.pid
fieldkeys/
.crt*
scripts/docker/feedcrunch_orchester.json
5 changes: 3 additions & 2 deletions application/celery.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ def load_env():
# Load task modules from all registered Django app configs.
app.autodiscover_tasks()

app.conf.broker_url = settings.BROKER_URL
app.conf.broker_use_ssl = settings.BROKER_USE_SSL
app.conf.broker_url = settings.CELERY_BROKER_URL
app.conf.broker_use_ssl = settings.CELERY_BROKER_USE_SSL
app.conf.broker_heartbeat = settings.CELERY_BROKER_HEARTBEAT
app.conf.accept_content = settings.CELERY_ACCEPT_CONTENT
app.conf.timezone = settings.CELERY_TIMEZONE
app.conf.enable_utc = settings.CELERY_ENABLE_UTC
Expand Down
7 changes: 4 additions & 3 deletions application/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,11 +309,12 @@ def assign_env_value(var_name):

# Celery Configuration
if assign_env_value('USE_RABBITMQ'):
BROKER_URL = assign_env_value('RABBITMQ_URL')
CELERY_BROKER_URL = assign_env_value('RABBITMQ_URL')
else:
BROKER_URL = assign_env_value('REDIS_URL')
CELERY_BROKER_URL = assign_env_value('REDIS_URL')

BROKER_USE_SSL=True
CELERY_BROKER_USE_SSL = True
CELERY_BROKER_HEARTBEAT = 0

CELERY_ACCEPT_CONTENT = ['application/json']
CELERY_TIMEZONE = TIME_ZONE
Expand Down

0 comments on commit e94a0a1

Please sign in to comment.