Browse Source

Merge branch 'master' of github.com:celery/celery

Ask Solem 12 years ago
parent
commit
e29177c635
1 changed files with 5 additions and 2 deletions
  1. 5 2
      celery/worker/control.py

+ 5 - 2
celery/worker/control.py

@@ -236,8 +236,11 @@ def pool_shrink(panel, n=1, **kwargs):
 
 @Panel.register
 def pool_restart(panel, modules=None, reload=False, reloader=None, **kwargs):
-    panel.consumer.controller.reload(modules, reload, reloader=reloader)
-    return {'ok': 'reload started'}
+    if panel.app.conf.CELERYD_POOL_RESTARTS:
+        panel.consumer.controller.reload(modules, reload, reloader=reloader)
+        return {'ok': 'reload started'}
+    else:
+        raise ValueError('Pool restarts not enabled')
 
 
 @Panel.register