Skip to content
Snippets Groups Projects
Commit 18b0be65 authored by Sybren A. Stüvel's avatar Sybren A. Stüvel
Browse files

Added shutdown check to sleep state to prevent infinite loops

parent 9a35b47e
No related branches found
No related tags found
No related merge requests found
...@@ -808,7 +808,7 @@ class FlamencoWorker: ...@@ -808,7 +808,7 @@ class FlamencoWorker:
async def sleeping(self): async def sleeping(self):
"""Regularly polls the Manager to see if we're allowed to wake up again.""" """Regularly polls the Manager to see if we're allowed to wake up again."""
while True: while self.state != WorkerState.SHUTTING_DOWN and self.loop.is_running():
try: try:
await asyncio.sleep(ASLEEP_POLL_STATUS_CHANGE_REQUESTED_DELAY) await asyncio.sleep(ASLEEP_POLL_STATUS_CHANGE_REQUESTED_DELAY)
resp = await self.manager.get('/status-change', loop=self.loop) resp = await self.manager.get('/status-change', loop=self.loop)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment