MCPcopy
hub / github.com/celery/celery / is_due

Method is_due

celery/schedules.py:863–878  ·  view source on GitHub ↗

Return tuple of ``(is_due, next_time_to_run)``. Note: next time to run is in seconds. See Also: :meth:`celery.schedules.schedule.is_due` for more information.

(self, last_run_at: datetime)

Source from the content-addressed store, hash-verified

861 return delta
862
863 def is_due(self, last_run_at: datetime) -> tuple[bool, datetime]:
864 """Return tuple of ``(is_due, next_time_to_run)``.
865
866 Note:
867 next time to run is in seconds.
868
869 See Also:
870 :meth:`celery.schedules.schedule.is_due` for more information.
871 """
872 rem_delta = self.remaining_estimate(last_run_at)
873 rem = max(rem_delta.total_seconds(), 0)
874 due = rem == 0
875 if due:
876 rem_delta = self.remaining_estimate(self.now())
877 rem = max(rem_delta.total_seconds(), 0)
878 return schedstate(due, rem)
879
880 def __eq__(self, other: Any) -> bool:
881 if isinstance(other, solar):

Callers

nothing calls this directly

Calls 2

remaining_estimateMethod · 0.95
nowMethod · 0.45

Tested by

no test coverage detected