From d7ea809d457afafce60d7e3a88a3343ca4f09ef8 Mon Sep 17 00:00:00 2001
From: David Trattnig <david.trattnig@o94.at>
Date: Thu, 4 Jun 2020 11:35:35 +0200
Subject: [PATCH] Reload config on scheduling cycle.

---
 modules/scheduling/scheduler.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/modules/scheduling/scheduler.py b/modules/scheduling/scheduler.py
index fdb02189..720d2cc4 100644
--- a/modules/scheduling/scheduler.py
+++ b/modules/scheduling/scheduler.py
@@ -132,9 +132,12 @@ class AuraScheduler(threading.Thread):
             1. `self.fetch_new_programme()` periodically from the API depending on the `fetching_frequency` defined in the engine configuration. 
             2. Loads the latest programme from the database and sets the instance state `self.programme` with current schedules.
             3. Queues all playlists of the programm, if the soundssystem is ready to accept commands.
+
+        On every cycle the configuration file is reloaded, to allow modifications while running the engine.
         """
         while not self.exit_event.is_set():
             try:
+                self.config.load_config()
                 seconds_to_wait = int(self.config.get("fetching_frequency"))
                 self.logger.info(SimpleUtil.cyan("== start fetching new schedules =="))
                 next_time = datetime.datetime.now() + datetime.timedelta(seconds=seconds_to_wait)
-- 
GitLab