|
@@ -11,10 +11,24 @@ import redis
|
|
|
from celery.schedules import crontab
|
|
|
import celery
|
|
|
from celery.signals import celeryd_init
|
|
|
+from celery import signals
|
|
|
+from celery.bin.base import Option
|
|
|
|
|
|
|
|
|
app = Celery('tasks', backend ='redis://172.104.92.245', broker='redis://172.104.92.245')
|
|
|
qname=None
|
|
|
+
|
|
|
+app.user_options['preload'].add(Option(
|
|
|
+ '--jared', action='store_true',
|
|
|
+ help='Enable our external monitoring utility, blahblah',
|
|
|
+))
|
|
|
+
|
|
|
+@signals.user_preload_options.connect
|
|
|
+def handle_preload_options(options, **kwargs):
|
|
|
+ if options['jared']:
|
|
|
+ print(options)
|
|
|
+# enable_monitoring()
|
|
|
+
|
|
|
@celeryd_init.connect
|
|
|
def configure_workers(sender=None, **kwargs):
|
|
|
global qname
|