mirror of
https://github.com/LibreQoE/LibreQoS.git
synced 2024-11-22 08:16:25 -06:00
Merge pull request #356 from LibreQoE/fixScheduler2
Fix scheduler concurrence issues
This commit is contained in:
commit
a306ac16db
@ -12,8 +12,9 @@ if automaticImportUISP:
|
|||||||
if automaticImportSplynx:
|
if automaticImportSplynx:
|
||||||
from integrationSplynx import importFromSplynx
|
from integrationSplynx import importFromSplynx
|
||||||
from apscheduler.schedulers.background import BlockingScheduler
|
from apscheduler.schedulers.background import BlockingScheduler
|
||||||
|
from apscheduler.executors.pool import ThreadPoolExecutor
|
||||||
|
|
||||||
ads = BlockingScheduler()
|
ads = BlockingScheduler(executors={'default': ThreadPoolExecutor(1)})
|
||||||
|
|
||||||
def importFromCRM():
|
def importFromCRM():
|
||||||
if automaticImportUISP:
|
if automaticImportUISP:
|
||||||
@ -48,9 +49,9 @@ def importAndShapePartialReload():
|
|||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
importAndShapeFullReload()
|
importAndShapeFullReload()
|
||||||
|
|
||||||
ads.add_job(importAndShapePartialReload, 'interval', minutes=queueRefreshIntervalMins)
|
ads.add_job(importAndShapePartialReload, 'interval', minutes=queueRefreshIntervalMins, max_instances=1)
|
||||||
|
|
||||||
if influxDBEnabled:
|
if influxDBEnabled:
|
||||||
ads.add_job(graphHandler, 'interval', seconds=10)
|
ads.add_job(graphHandler, 'interval', seconds=10, max_instances=1)
|
||||||
|
|
||||||
ads.start()
|
ads.start()
|
||||||
|
Loading…
Reference in New Issue
Block a user