Potentially fixed bug to kill web api on restart #301

This commit is contained in:
2023-04-10 00:13:09 +02:00
parent c01a6b97fe
commit 010dafc655
3 changed files with 22 additions and 2 deletions

View File

@@ -65,6 +65,9 @@ class Application(DiscordBotApplicationABC):
self._is_stopping = True
try:
self._logger.info(__name__, f"Try to stop {DiscordBotService.__name__}")
if self._feature_flags.get_flag(FeatureFlagsEnum.api_module):
self._api.stop()
await self._bot.close()
self._logger.info(__name__, f"Stopped {DiscordBotService.__name__}")
except Exception as e: