Skip to content

Commit 49cbce2

Browse files
committed
Merge branch 'pegler/remote-control-toggle'
2 parents cb874d5 + 6b2ef35 commit 49cbce2

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

celery/app/defaults.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ def __repr__(self):
113113
'DEFAULT_DELIVERY_MODE': Option(2, type='string'),
114114
'EAGER_PROPAGATES_EXCEPTIONS': Option(False, type='bool'),
115115
'ENABLE_UTC': Option(True, type='bool'),
116+
'ENABLE_REMOTE_CONTROL': Option(True, type='bool'),
116117
'EVENT_SERIALIZER': Option('json'),
117118
'EVENT_QUEUE_EXPIRES': Option(None, type='float'),
118119
'EVENT_QUEUE_TTL': Option(None, type='float'),

celery/worker/consumer.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ def __init__(self, on_task,
201201
# so if the connection timeout is exceeded once, it can NEVER
202202
# connect again.
203203
self.app.conf.BROKER_CONNECTION_TIMEOUT = None
204-
204+
205205
self.steps = []
206206
self.blueprint = self.Blueprint(
207207
app=self.app, on_close=self.on_close,
@@ -484,10 +484,13 @@ def __init__(self, c, **kwargs):
484484
self.start = self.box.start
485485
self.stop = self.box.stop
486486
self.shutdown = self.box.shutdown
487+
488+
def include_if(self, c):
489+
return c.app.conf.CELERY_ENABLE_REMOTE_CONTROL
487490

488491

489492
class Tasks(bootsteps.StartStopStep):
490-
requires = (Control, )
493+
requires = ()
491494

492495
def __init__(self, c, initial_prefetch_count=2, **kwargs):
493496
c.task_consumer = c.qos = None

docs/configuration.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1336,6 +1336,16 @@ rechecking the schedule. Default is 1 second.
13361336
Setting this value to 1 second means the schedulers precision will
13371337
be 1 second. If you need near millisecond precision you can set this to 0.1.
13381338

1339+
.. setting:: CELERY_ENABLE_REMOTE_CONTROL
1340+
1341+
CELERY_ENABLE_REMOTE_CONTROL
1342+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1343+
1344+
Specify if remote control of the workers is enabled.
1345+
1346+
Default is :const:`True`.
1347+
1348+
13391349
.. _conf-error-mails:
13401350

13411351
Error E-Mails

0 commit comments

Comments
 (0)