diff options
author | Evgeny Zinoviev <me@ch1p.io> | 2022-06-11 23:43:19 +0300 |
---|---|---|
committer | Evgeny Zinoviev <me@ch1p.io> | 2022-06-11 23:43:19 +0300 |
commit | 97f7ce7602f4a284ac868e3c4d8f5551ac03aca0 (patch) | |
tree | 89a6f948d8b5f90ce978686b6f50e7b6cde95190 | |
parent | cf34b77a5f84e552f8cf6f3ce025a0684d651d2c (diff) |
ipcam_server: control fix job task by config
-rwxr-xr-x | src/ipcam_server.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/ipcam_server.py b/src/ipcam_server.py index d706651..56b6e18 100755 --- a/src/ipcam_server.py +++ b/src/ipcam_server.py @@ -372,9 +372,13 @@ if __name__ == '__main__': loop = asyncio.get_event_loop() - scheduler = AsyncIOScheduler(event_loop=loop) - scheduler.add_job(fix_job, 'interval', seconds=config['fix_interval']) - scheduler.start() + try: + if config['fix_enabled']: + scheduler = AsyncIOScheduler(event_loop=loop) + scheduler.add_job(fix_job, 'interval', seconds=config['fix_interval']) + scheduler.start() + except KeyError: + pass server = IPCamWebServer(parse_addr(config['server']['listen'])) server.run() |