Rechargement à chaud de la configuration

Signed-off-by: ynerant <ynerant@zamokv5.crans.org>
This commit is contained in:
ynerant 2021-05-11 17:38:09 +02:00
parent 3484ee3b9c
commit d04f8fc790
1 changed files with 6 additions and 1 deletions

View File

@ -150,6 +150,11 @@ def main():
irc_client.privmsg(config.irc.channel, ' '.join(str(a) for a in mesg))
while True:
# Rechargement de la configuration
with open('config.yml') as f:
config = yaml.safe_load(f)
config = Config(**config)
centres_id = [] # Centres disponibles
for search in config.search:
@ -183,7 +188,7 @@ def main():
already_indicated.remove(centre_id)
# 5 minutes
sleep(300)
sleep(config.delay)
if __name__ == '__main__':