Skip to content

Commit 024112a

Browse files
authored
Ensure future in sleep method (#34)
1 parent 41bbe38 commit 024112a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mode/services.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ async def sleep(self, n: Seconds) -> None:
694694
"""Sleep for ``n`` seconds, or until service stopped."""
695695
try:
696696
await asyncio.wait_for(
697-
self._stopped.wait(),
697+
asyncio.ensure_future(self._stopped.wait(), loop=self.loop),
698698
timeout=want_seconds(n),
699699
)
700700
except asyncio.TimeoutError:

0 commit comments

Comments
 (0)