Open ShipraShalini opened 7 years ago
If there's nothing in your database, then no tasks are going to be run. The library does not take care of adding things to the database for you, it reads what you have specified there.
I am also facing similar issue. I have 9 tasks defined in the mongo collection. However the task is only picked up once during startup. From next time onwards no task is re run at the specified interval.
{ "_id" : ObjectId("5caae53b0479fc63a8dfb7f5"), "_cls" : "PeriodicTask", "args" : [ { "lReqQueues" : [ "ocr_queue", "nlp_pdf_queue" ] } ], "enabled" : true, "interval" : { "every" : 2, "period" : "minutes" }, "kwargs" : {
},
"last_run_at" : ISODate("2019-04-08T23:30:01.669+05:30"),
"name" : "run_aws_auto_scaler",
"run_immediately" : false,
"task" : "job_man.tasks.run_aws_auto_scaler",
"total_run_count" : 14,
"type" : "defaultScheduler",
"client_id" : "0",
"scheduler_id" : "JS_50",
"updated_date" : ISODate("2019-04-04T20:49:05.068+05:30"),
"updated_by" : null
}
I am also facing similar issue. I have 9 tasks defined in the mongo collection. However the task is only picked up once during startup. From next time onwards no task is re run at the specified interval.
{ "_id" : ObjectId("5caae53b0479fc63a8dfb7f5"), "_cls" : "PeriodicTask", "args" : [ { "lReqQueues" : [ "ocr_queue", "nlp_pdf_queue" ] } ], "enabled" : true, "interval" : { "every" : 2, "period" : "minutes" }, "kwargs" : {
}, "last_run_at" : ISODate("2019-04-08T23:30:01.669+05:30"), "name" : "run_aws_auto_scaler", "run_immediately" : false, "task" : "job_man.tasks.run_aws_auto_scaler", "total_run_count" : 14, "type" : "defaultScheduler", "client_id" : "0", "scheduler_id" : "JS_50", "updated_date" : ISODate("2019-04-04T20:49:05.068+05:30"), "updated_by" : null
}
Were you able to resolve this issue? I am facing the exact same issue
I am running a simple test to print hello every 30 sec using celery 4.0.2 in my django app.
My celery config is:
The task is picked up when using the default
celery.beat.PersistentScheduler
but not when using thecelerybeatmongo.schedulers.MongoScheduler
The command I use is:
celery beat -A proj -l debug -S celerybeatmongo.schedulers.MongoScheduler
The log says:
There's no document in the mongoDB.
The mongodb is my main database and the user has read-write permission.
Is there any way to fix it? Am I doing anything wrong??