Skip to content

Commit

Permalink
Close the work queue on Executor shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
azawlocki committed May 27, 2021
1 parent ebe9282 commit 4b8891f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions yapapi/executor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1113,6 +1113,9 @@ async def worker_starter() -> None:
cancelled = True

finally:

await work_queue.close()

# Importing this at the beginning would cause circular dependencies
from ..log import pluralize

Expand Down
1 change: 1 addition & 0 deletions yapapi/executor/_smartq.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ async def close(self):
if self._buffer_task:
self._buffer_task.cancel()
await self._buffer_task
self._buffer_task = None

def finished(self):
return (
Expand Down

0 comments on commit 4b8891f

Please sign in to comment.