Skip to content

Commit bb46cbc

Browse files
committed
Send STOPPED message when duration is reached
Signed-off-by: Mathias L. Baumann <[email protected]>
1 parent 15e619f commit bb46cbc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/frequenz/dispatch/_dispatch.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ def running(self, type_: str) -> RunningState:
117117
if not self.active or self.deleted:
118118
return RunningState.STOPPED
119119

120+
# A dispatch without duration is always running
121+
if self.duration is None:
122+
return RunningState.RUNNING
123+
120124
now = datetime.now(tz=timezone.utc)
121125
if until := self._until(now):
122126
return RunningState.RUNNING if now < until else RunningState.STOPPED

0 commit comments

Comments
 (0)