celerybeat-mongo
celerybeat-mongo copied to clipboard
Celery 4+ compatibility
Looks like lost :(( I fixed it with modifying this:
def get_from_database(self):
d = {}
for doc in PeriodicTask.objects():
if doc.enabled:
d[doc.name] = MongoScheduleEntry(doc)
return d
And remapping tick method:
def tick(self, *args, **kwargs):
"""Run a tick - one iteration of the scheduler.
Executes one due task per call.
Returns:
float: preferred delay in seconds for next call.
"""
adjust = self.adjust
intervals = []
for entry in self.schedule.values():
is_due, next_time_to_run = self.is_due(entry)
intervals.append(adjust(next_time_to_run))
if is_due:
next_entry = self.reserve(entry)
self.apply_entry(entry, producer=self.producer)
return min(intervals + [self.sync_every])
Would you be willing to submit a PR that fixes this?
I'm not really sure of that. It's rapid fix to make it work.
celerybeat-mongo is compatible with celery 4. I think this issue can be closed, @zakird