Skip to content

Commit 1509e1b

Browse files
committed
fixup! Rewrite internal arc
1 parent f3b1103 commit 1509e1b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/frequenz/dispatch/actor.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,10 +266,11 @@ def _schedule_start(self, dispatch: Dispatch) -> None:
266266
return
267267

268268
# Schedule the next run
269-
next_run = dispatch.next_run
270-
assert next_run is not None
271-
heappush(self._scheduled_events, (next_run, dispatch))
272-
_logger.debug("Scheduled dispatch %s to start at %s", dispatch, next_run)
269+
if next_run := dispatch.next_run:
270+
heappush(self._scheduled_events, (next_run, dispatch))
271+
_logger.debug("Scheduled dispatch %s to start at %s", dispatch.id, next_run)
272+
else:
273+
_logger.debug("Dispatch %s has no next run", dispatch.id)
273274

274275
def _schedule_stop(self, dispatch: Dispatch) -> None:
275276
"""Schedule a dispatch to stop.

0 commit comments

Comments
 (0)