Hotfix for 'RuntimeError: no running event loop'

See https://gitlab.com/ekzyis/musicube/issues/22
This commit is contained in:
ekzyis 2021-11-15 21:16:09 +01:00
parent c6f045a96e
commit 1a077215fa
1 changed files with 6 additions and 2 deletions

View File

@ -62,5 +62,9 @@ class DiscordLogger(logging.Handler):
if self._channel is not None:
await self._channel.send(msg)
asyncio.create_task(_emit_to_channel())
try:
asyncio.create_task(_emit_to_channel())
except RuntimeError:
# This is a hotfix for "RuntimeError: no running event loop" (see #22)
# TODO investigate #22 and replace hotfix with proper fix
pass