Update scheduler.py

This commit is contained in:
Robert Chacón 2023-12-20 08:46:43 -07:00 committed by GitHub
parent 358fb4189f
commit 68e9244306
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,7 +2,7 @@ import time
import datetime import datetime
from LibreQoS import refreshShapers, refreshShapersUpdateOnly from LibreQoS import refreshShapers, refreshShapersUpdateOnly
from graphInfluxDB import refreshBandwidthGraphs, refreshLatencyGraphs from graphInfluxDB import refreshBandwidthGraphs, refreshLatencyGraphs
from ispConfig import influxDBEnabled, automaticImportUISP, automaticImportSplynx, automaticImportSonar from ispConfig import influxDBEnabled, automaticImportUISP, automaticImportSplynx
try: try:
from ispConfig import queueRefreshIntervalMins from ispConfig import queueRefreshIntervalMins
except: except:
@ -11,6 +11,16 @@ if automaticImportUISP:
from integrationUISP import importFromUISP from integrationUISP import importFromUISP
if automaticImportSplynx: if automaticImportSplynx:
from integrationSplynx import importFromSplynx from integrationSplynx import importFromSplynx
try:
from ispConfig import automaticImportPowercode
except:
automaticImportPowercode = False
if automaticImportPowercode:
from integrationPowercode import importFromPowercode
try:
from ispConfig import automaticImportSonar
except:
automaticImportSonar = False
if automaticImportSonar: if automaticImportSonar:
from integrationSonar import importFromSonar from integrationSonar import importFromSonar
from apscheduler.schedulers.background import BlockingScheduler from apscheduler.schedulers.background import BlockingScheduler
@ -29,6 +39,11 @@ def importFromCRM():
importFromSplynx() importFromSplynx()
except: except:
print("Failed to import from Splynx") print("Failed to import from Splynx")
elif automaticImportPowercode:
try:
importFromPowercode()
except:
print("Failed to import from Powercode")
elif automaticImportSonar: elif automaticImportSonar:
try: try:
importFromSonar() importFromSonar()