Skip to content

Instantly share code, notes, and snippets.

@EnTeQuAk
Created February 10, 2011 09:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EnTeQuAk/820186 to your computer and use it in GitHub Desktop.
Save EnTeQuAk/820186 to your computer and use it in GitHub Desktop.
diff --git a/djcelery/schedulers.py b/djcelery/schedulers.py
index cf17f3b..eaa5525 100644
--- a/djcelery/schedulers.py
+++ b/djcelery/schedulers.py
@@ -51,6 +51,13 @@ class ModelEntry(ScheduleEntry):
self.model.no_changes = True
return self.__class__(self.model)
+ def is_due(self):
+ """See :meth:`celery.task.base.PeriodicTask.is_due`."""
+ due = self.schedule.is_due(self.last_run_at)
+ if self.model.enabled:
+ return due
+ return False, due
+
def save(self):
# Object may not be synchronized, so only
# change the fields we care about.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment