MCPcopy
hub / github.com/celery/celery / _when

Method _when

celery/beat.py:300–308  ·  view source on GitHub ↗

Return a utc timestamp, make sure heapq in correct order.

(self, entry, next_time_to_run, mktime=timegm)

Source from the content-addressed store, hash-verified

298 return entry.is_due()
299
300 def _when(self, entry, next_time_to_run, mktime=timegm):
301 """Return a utc timestamp, make sure heapq in correct order."""
302 adjust = self.adjust
303
304 as_now = maybe_make_aware(entry.default_now())
305
306 return (mktime(as_now.utctimetuple()) +
307 as_now.microsecond / 1e6 +
308 (adjust(next_time_to_run) or 0))
309
310 def populate_heap(self, event_t=event_t, heapify=heapq.heapify):
311 """Populate the heap with the data contained in the schedule."""

Callers 3

populate_heapMethod · 0.95
tickMethod · 0.95
test_whenMethod · 0.80

Calls 2

maybe_make_awareFunction · 0.85
default_nowMethod · 0.80

Tested by 1

test_whenMethod · 0.64