Skip to content

Commit

Permalink
Ensure future in sleep method (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
wbarnha authored Nov 30, 2022
1 parent 41bbe38 commit 024112a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mode/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ async def sleep(self, n: Seconds) -> None:
"""Sleep for ``n`` seconds, or until service stopped."""
try:
await asyncio.wait_for(
self._stopped.wait(),
asyncio.ensure_future(self._stopped.wait(), loop=self.loop),
timeout=want_seconds(n),
)
except asyncio.TimeoutError:
Expand Down

0 comments on commit 024112a

Please sign in to comment.