kill bitbotctl connection after rehash

This commit is contained in:
jesopo 2019-10-11 15:58:47 +01:00
parent 0bdce04306
commit 85a8ddf2d1

View file

@ -87,14 +87,21 @@ class Control(PollSource.PollSource):
response_action = "ack" response_action = "ack"
response_data = None response_data = None
keepalive = True
if command == "version": if command == "version":
client.version = int(data) client.version = int(data)
elif command == "log": elif command == "log":
client.log_level = Logging.LEVELS[data.lower()] client.log_level = Logging.LEVELS[data.lower()]
elif command == "rehash": elif command == "rehash":
self._bot.log.info("Reloading config file")
self._bot.config.load() self._bot.config.load()
self._bot.log.info("Reloaded config file")
keepalive = False
self._send_action(client, response_action, response_data, id) self._send_action(client, response_action, response_data, id)
if not keepalive:
client.disconnect()
def _send_action(self, client: ControlClient, action: str, data: str, def _send_action(self, client: ControlClient, action: str, data: str,
id: int=None): id: int=None):