Skip to content

Commit

Permalink
fix: initialize _last_expected_time with current time
Browse files Browse the repository at this point in the history
This prevents a burst of iterations occuring due to the deadlines
starting at 0 instead of from whatever time the clock is at.
  • Loading branch information
thegamecracks committed Jun 16, 2024
1 parent 2f9cd1b commit bc8ca39
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions sardine_core/scheduler/async_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -627,9 +627,7 @@ def _prepare(self):
Prepare the runner for an incoming iteration. This method is called at the
start of the runner's main loop. TODO: add more.
"""
self._last_expected_time = -math.inf

# Grab function, arguments and key arguments stored in state
self._last_expected_time = self.clock.time
self._last_state = self._get_state()

# Setting flags
Expand Down

0 comments on commit bc8ca39

Please sign in to comment.