summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2022-06-11 23:43:19 +0300
committerEvgeny Zinoviev <me@ch1p.io>2022-06-11 23:43:19 +0300
commit97f7ce7602f4a284ac868e3c4d8f5551ac03aca0 (patch)
tree89a6f948d8b5f90ce978686b6f50e7b6cde95190
parentcf34b77a5f84e552f8cf6f3ce025a0684d651d2c (diff)
ipcam_server: control fix job task by config
-rwxr-xr-xsrc/ipcam_server.py10
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()