Merge branch '22-queue-stops-working-after-reconnect' into 'develop'

Hotfix for 'RuntimeError: no running event loop' during sendings logs to discord

See merge request ekzyis/musicube!22
This commit is contained in:
Ramdip Gill 2021-11-15 20:20:04 +00:00
commit 58c165902c
2 changed files with 8 additions and 3 deletions

View File

@ -13,7 +13,8 @@ disable=
redefined-outer-name,
invalid-name,
no-self-use,
too-many-instance-attributes
too-many-instance-attributes,
fixme
[FORMAT]
indent-string=' '

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