From c1cd782299d48fd5dad0a07283bff1e62215fdac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Chac=C3=B3n?= Date: Thu, 18 May 2023 17:22:50 -0600 Subject: [PATCH] Update scheduler.py --- src/scheduler.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/scheduler.py b/src/scheduler.py index 0c1de7ba..f35bfd10 100644 --- a/src/scheduler.py +++ b/src/scheduler.py @@ -12,8 +12,9 @@ if automaticImportUISP: if automaticImportSplynx: from integrationSplynx import importFromSplynx from apscheduler.schedulers.background import BlockingScheduler +from apscheduler.executors.pool import ThreadPoolExecutor -ads = BlockingScheduler() +ads = BlockingScheduler(executors={'default': ThreadPoolExecutor(1)}) def importFromCRM(): if automaticImportUISP: @@ -48,9 +49,9 @@ def importAndShapePartialReload(): if __name__ == '__main__': importAndShapeFullReload() - ads.add_job(importAndShapePartialReload, 'interval', minutes=queueRefreshIntervalMins) + ads.add_job(importAndShapePartialReload, 'interval', minutes=queueRefreshIntervalMins, max_instances=1) if influxDBEnabled: - ads.add_job(graphHandler, 'interval', seconds=10) + ads.add_job(graphHandler, 'interval', seconds=10, max_instances=1) ads.start()