projects
/
music-assistant-server.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d840d2c
)
Fix: Add guard for taskmanager aexit. (#1459)
author
Marvin Schenkel
<marvinschenkel@gmail.com>
Sat, 6 Jul 2024 15:06:37 +0000
(17:06 +0200)
committer
GitHub
<noreply@github.com>
Sat, 6 Jul 2024 15:06:37 +0000
(17:06 +0200)
Add guard for taskmanager aexit.
music_assistant/server/helpers/util.py
patch
|
blob
|
history
diff --git
a/music_assistant/server/helpers/util.py
b/music_assistant/server/helpers/util.py
index 08f6d79b5cecaa80b9c4ad5544e3e7b8e956d453..b5afcc263bd635b2d00c1630a57430e21f37255f 100644
(file)
--- a/
music_assistant/server/helpers/util.py
+++ b/
music_assistant/server/helpers/util.py
@@
-165,5
+165,6
@@
class TaskManager:
exc_tb: TracebackType | None,
) -> bool | None:
"""Exit context manager."""
- await asyncio.wait(self._tasks)
- self._tasks.clear()
+ if len(self._tasks) > 0:
+ await asyncio.wait(self._tasks)
+ self._tasks.clear()