Skip to content
Snippets Groups Projects
Commit d7ea809d authored by David Trattnig's avatar David Trattnig
Browse files

Reload config on scheduling cycle.

parent 4aced52c
No related branches found
No related tags found
No related merge requests found
...@@ -132,9 +132,12 @@ class AuraScheduler(threading.Thread): ...@@ -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. 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. 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. 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(): while not self.exit_event.is_set():
try: try:
self.config.load_config()
seconds_to_wait = int(self.config.get("fetching_frequency")) seconds_to_wait = int(self.config.get("fetching_frequency"))
self.logger.info(SimpleUtil.cyan("== start fetching new schedules ==")) self.logger.info(SimpleUtil.cyan("== start fetching new schedules =="))
next_time = datetime.datetime.now() + datetime.timedelta(seconds=seconds_to_wait) next_time = datetime.datetime.now() + datetime.timedelta(seconds=seconds_to_wait)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment