From 607b7d8aee4a584a2f6e8594137a8a4e733f344c Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Wed, 14 Jun 2023 11:48:49 +0200 Subject: [PATCH] Ensure bot shutdown before data checks #292_shutdown_procedure --- kdb-bot/src/bot/application.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kdb-bot/src/bot/application.py b/kdb-bot/src/bot/application.py index dcedeb08..ca3e0976 100644 --- a/kdb-bot/src/bot/application.py +++ b/kdb-bot/src/bot/application.py @@ -70,8 +70,8 @@ class Application(DiscordBotApplicationABC): if self._feature_flags.get_flag(FeatureFlagsEnum.api_module): self._api.stop() - self._data_integrity.check_data_integrity(is_for_shutdown=True) await self._bot.close() + self._data_integrity.check_data_integrity(is_for_shutdown=True) self._logger.info(__name__, f"Stopped {DiscordBotService.__name__}") except Exception as e: self._logger.error(__name__, "stop failed", e) @@ -79,4 +79,4 @@ class Application(DiscordBotApplicationABC): Console.write_line() def is_restart(self): - return True if self._configuration.get_configuration("IS_RESTART") == "true" else False # + return True if self._configuration.get_configuration("IS_RESTART") == "true" else False