|
@@ -10,16 +10,18 @@ from celery import Celery
|
|
|
import redis
|
|
|
from celery.schedules import crontab
|
|
|
import celery
|
|
|
+from celery.signals import celeryd_init
|
|
|
|
|
|
-from billiard import current_process
|
|
|
|
|
|
app = Celery('tasks', backend ='redis://172.104.92.245', broker='redis://172.104.92.245')
|
|
|
|
|
|
-
|
|
|
-#rkey=app.request.delivery_info['routing_key']
|
|
|
-print("******")
|
|
|
-print(app.select_queues)
|
|
|
-print("******")
|
|
|
+@celeryd_init.connect
|
|
|
+def configure_workers(sender=None, **kwargs):
|
|
|
+ worker_name = sender.split("@")[-1]
|
|
|
+ #rkey=app.request.delivery_info['routing_key']
|
|
|
+ print("******")
|
|
|
+ print(worker_name)
|
|
|
+ print("******")
|
|
|
|
|
|
app.conf.beat_schedule = {
|
|
|
# Executes every Monday morning at 7:30 a.m.
|
|
@@ -43,10 +45,6 @@ app.conf.beat_schedule = {
|
|
|
|
|
|
@app.task()
|
|
|
def selenium_jared_click():
|
|
|
- print('*****')
|
|
|
- p = current_process()
|
|
|
- print(p.initargs[1].split('@')[1])
|
|
|
- print('*****')
|
|
|
|
|
|
|
|
|
db = dataset.connect('postgresql://postgres:eyJhbGciOiJI@172.105.241.163:5432/postgres')
|