aboutsummaryrefslogtreecommitdiff
path: root/src/Control.py
diff options
context:
space:
mode:
authorGravatar jesopo2019-10-11 15:58:47 +0100
committerGravatar jesopo2019-10-11 15:58:47 +0100
commit85a8ddf2d194dd519a8134d7404d939742e62c67 (patch)
tree2ad41e28cb9456a41c1073034c3f4fc3119b713e /src/Control.py
parentactually send rehash command (diff)
signature
kill bitbotctl connection after rehash
Diffstat (limited to 'src/Control.py')
-rw-r--r--src/Control.py7
1 files changed, 7 insertions, 0 deletions
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):