Browse Source

Use the now() from the underlying schedule in ScheduleEntry

If a schedule defines a custom nowfun, then the ScheduleEntry should use that instead of the app default
Raphaël Slinckx 12 years ago
parent
commit
f92be2770c
1 changed files with 1 additions and 1 deletions
  1. 1 1
      celery/beat.py

+ 1 - 1
celery/beat.py

@@ -90,7 +90,7 @@ class ScheduleEntry(object):
         self.total_run_count = total_run_count or 0
 
     def _default_now(self):
-        return current_app.now()
+        return self.schedule.now() if self.schedule else current_app.now()
 
     def _next_instance(self, last_run_at=None):
         """Returns a new instance of the same class, but with