Allow overriding broker heartbeat (#21567)
BROKER_HEARTBEAT appears to interfere with the celery worker configuration. If we want to disable or change the heartbeat interval, It must be from these configuration options. Just setting --without-heartbeat and/or --heartbeat-interval on the workers does not fully work. Eg. --without-heartbeat disables sending heartbeats, but BROKER_HEARTBEAT = 60 means that the connection will get a 60s heartbeat interval negotiated.
This commit is contained in:
@@ -96,8 +96,8 @@ CELERY_RESULT_BACKEND = 'djcelery.backends.cache:CacheBackend'
|
||||
|
||||
# When the broker is behind an ELB, use a heartbeat to refresh the
|
||||
# connection and to detect if it has been dropped.
|
||||
BROKER_HEARTBEAT = 60.0
|
||||
BROKER_HEARTBEAT_CHECKRATE = 2
|
||||
BROKER_HEARTBEAT = ENV_TOKENS.get('BROKER_HEARTBEAT', 60.0)
|
||||
BROKER_HEARTBEAT_CHECKRATE = ENV_TOKENS.get('BROKER_HEARTBEAT_CHECKRATE', 2)
|
||||
|
||||
# Each worker should only fetch one message at a time
|
||||
CELERYD_PREFETCH_MULTIPLIER = 1
|
||||
|
||||
@@ -108,8 +108,8 @@ CELERY_RESULT_BACKEND = 'djcelery.backends.cache:CacheBackend'
|
||||
|
||||
# When the broker is behind an ELB, use a heartbeat to refresh the
|
||||
# connection and to detect if it has been dropped.
|
||||
BROKER_HEARTBEAT = 60.0
|
||||
BROKER_HEARTBEAT_CHECKRATE = 2
|
||||
BROKER_HEARTBEAT = ENV_TOKENS.get('BROKER_HEARTBEAT', 60.0)
|
||||
BROKER_HEARTBEAT_CHECKRATE = ENV_TOKENS.get('BROKER_HEARTBEAT_CHECKRATE', 2)
|
||||
|
||||
# Each worker should only fetch one message at a time
|
||||
CELERYD_PREFETCH_MULTIPLIER = 1
|
||||
|
||||
Reference in New Issue
Block a user