Skip to content

Commit 7cb0687

Browse files
committed
Expose duration through DispatchInfo
Some dispatches need the duration to make an execution plan. Signed-off-by: Sahas Subramanian <[email protected]>
1 parent 793cbd8 commit 7cb0687

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/frequenz/dispatch/_actor_dispatcher.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ class DispatchInfo:
3232
options: dict[str, Any]
3333
"""Additional options."""
3434

35+
duration: timedelta | None
36+
"""The duration of the dispatch."""
37+
3538

3639
class ActorDispatcher(BackgroundService):
3740
"""Helper class to manage actors based on dispatches.
@@ -229,6 +232,7 @@ async def _start_actor(self, dispatch: Dispatch) -> None:
229232
components=dispatch.target,
230233
dry_run=dispatch.dry_run,
231234
options=dispatch.payload,
235+
duration=dispatch.duration,
232236
)
233237

234238
identity = self._dispatch_identity(dispatch)

0 commit comments

Comments
 (0)