Explorar o código

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 %!s(int64=12) %!d(string=hai) anos
pai
achega
4b9841139f
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      celery/beat.py

+ 1 - 1
celery/beat.py

@@ -91,7 +91,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