Skip to content

Commit 23cc65f

Browse files
committed
Wait for bg services as well in Dispatcher.wait
Signed-off-by: Mathias L. Baumann <[email protected]>
1 parent e0c5d8d commit 23cc65f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/frequenz/dispatch/_dispatcher.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
from __future__ import annotations
77

8+
import asyncio
89
import logging
910
from asyncio import Event
1011
from typing import Callable
@@ -209,7 +210,7 @@ def is_running(self) -> bool:
209210
@override
210211
async def wait(self) -> None:
211212
"""Wait until all actor dispatches are stopped."""
212-
await self._empty_event.wait()
213+
await asyncio.gather(self._bg_service.wait(), self._empty_event.wait())
213214

214215
@override
215216
def cancel(self, msg: str | None = None) -> None:

0 commit comments

Comments
 (0)