From 85a8ddf2d194dd519a8134d7404d939742e62c67 Mon Sep 17 00:00:00 2001 From: jesopo Date: Fri, 11 Oct 2019 15:58:47 +0100 Subject: kill bitbotctl connection after rehash --- src/Control.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/Control.py') diff --git a/src/Control.py b/src/Control.py index b68bbddc..5b59bfec 100644 --- a/src/Control.py +++ b/src/Control.py @@ -87,14 +87,21 @@ class Control(PollSource.PollSource): response_action = "ack" response_data = None + keepalive = True + if command == "version": client.version = int(data) elif command == "log": client.log_level = Logging.LEVELS[data.lower()] elif command == "rehash": + self._bot.log.info("Reloading config file") self._bot.config.load() + self._bot.log.info("Reloaded config file") + keepalive = False self._send_action(client, response_action, response_data, id) + if not keepalive: + client.disconnect() def _send_action(self, client: ControlClient, action: str, data: str, id: int=None): -- cgit v1.3.1-10-gc9f91