Skip to content

Commit 7d43537

Browse files
committed
Clear dispatches after waiting for them to stop
Signed-off-by: Mathias L. Baumann <[email protected]>
1 parent 9747b15 commit 7d43537

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/frequenz/dispatch/_dispatcher.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,8 @@ async def wait(self) -> None:
212212
"""Wait until all actor dispatches are stopped."""
213213
await asyncio.gather(self._bg_service.wait(), self._empty_event.wait())
214214

215+
self._actor_dispatchers.clear()
216+
215217
@override
216218
def cancel(self, msg: str | None = None) -> None:
217219
"""Stop the local dispatch service."""
@@ -220,8 +222,6 @@ def cancel(self, msg: str | None = None) -> None:
220222
for instance in self._actor_dispatchers.values():
221223
instance.cancel()
222224

223-
self._actor_dispatchers.clear()
224-
225225
async def start_dispatching(
226226
self,
227227
dispatch_type: str,

0 commit comments

Comments
 (0)