From: Benjamin Braatz Date: Tue, 18 Jul 2023 23:08:51 +0000 (+0200) Subject: Do not reload configuration anymore. X-Git-Tag: v0.3.0 X-Git-Url: http://git.graph-it.com/?a=commitdiff_plain;h=03b8d24aaef6f2918c991817ec51782c6377bc93;p=graphit%2Fcontrolpi.git Do not reload configuration anymore. --- diff --git a/controlpi/__main__.py b/controlpi/__main__.py index 4569c7c..476626d 100644 --- a/controlpi/__main__.py +++ b/controlpi/__main__.py @@ -15,14 +15,10 @@ from controlpi import run, PluginConf from typing import Dict -restart = True - async def shutdown(sig: signal.Signals) -> None: """Shutdown the system in reaction to a signal.""" - global restart print(f"Shutting down on signal {sig.name}.") - restart = False for task in asyncio.all_tasks(): if task is not asyncio.current_task(): task.cancel() @@ -75,12 +71,10 @@ async def add_config_change_handler() -> pyinotify.AsyncioNotifier: async def main() -> None: """Set up signal handlers, read configuration file and run system.""" - global restart await add_signal_handlers() notifier = await add_config_change_handler() - while restart: - conf = read_configuration() - await run(conf) + conf = read_configuration() + await run(conf) notifier.stop() if __name__ == '__main__':