MCPcopy Create free account
hub / github.com/celery/celery / _when

Method _when

celery/beat.py:314–322  ·  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

312 return False, self.max_interval
313
314 def _when(self, entry, next_time_to_run, mktime=timegm):
315 """Return a utc timestamp, make sure heapq in correct order."""
316 adjust = self.adjust
317
318 as_now = maybe_make_aware(entry.default_now())
319
320 return (mktime(as_now.utctimetuple()) +
321 as_now.microsecond / 1e6 +
322 (adjust(next_time_to_run) or 0))
323
324 def populate_heap(self, event_t=event_t, heapify=heapq.heapify):
325 """Populate the heap with the data contained in the schedule."""

Calls 2

maybe_make_awareFunction · 0.85
default_nowMethod · 0.80