From 7c1cb0fc30323b19f81949fbc0bd2e2cf268c512 Mon Sep 17 00:00:00 2001 From: Ben Firshman Date: Mon, 5 Nov 2018 13:22:21 +0600 Subject: [PATCH] Fix Celery settings for Heroku --- modernomad/settings/common.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/modernomad/settings/common.py b/modernomad/settings/common.py index 083708d8..068418d7 100644 --- a/modernomad/settings/common.py +++ b/modernomad/settings/common.py @@ -211,7 +211,18 @@ CELERY_RESULT_SERIALIZER = 'json' CELERY_ENABLE_UTC = True CELERY_ACCEPT_CONTENT = ['json', 'yaml'] -CELERY_RESULT_BACKEND = BROKER_URL + +# Disabled when moving to Heroku for simplicity's sake, because no tasks +# have results. If results are needed, a suitable one can be picked for +# Heroku + CloudAMPQ. (Probably the "rpc" one, perhaps Django ORM?) +CELERY_RESULT_BACKEND = None + +# as per https://www.cloudamqp.com/docs/celery.html +BROKER_POOL_LIMIT = 1 +BROKER_HEARTBEAT = None +BROKER_CONNECTION_TIMEOUT = 30 +CELERY_EVENT_QUEUE_EXPIRES = 60 +CELERYD_PREFETCH_MULTIPLIER = 1 REST_FRAMEWORK = { 'DEFAULT_PERMISSION_CLASSES': [