1
0
mirror of https://github.com/donaldzou/WGDashboard.git synced 2024-11-06 16:00:28 +01:00

Update dashboard.py

This commit is contained in:
Donald Zou 2024-08-04 20:17:29 -04:00
parent 8c8374a08c
commit 201c8f9ec9

View File

@ -1840,7 +1840,7 @@ def index():
def backGroundThread(): def backGroundThread():
with app.app_context(): with app.app_context():
print(f"[WGDashboard][{datetime.now().strftime('%Y-%m-%d %H:%M:%S')}] Background Thread #1 Started") print(f"[WGDashboard] Background Thread #1 Started", flush=True)
time.sleep(10) time.sleep(10)
while True: while True:
for c in WireguardConfigurations.values(): for c in WireguardConfigurations.values():
@ -1850,13 +1850,13 @@ def backGroundThread():
c.getPeersLatestHandshake() c.getPeersLatestHandshake()
c.getPeersEndpoint() c.getPeersEndpoint()
except Exception as e: except Exception as e:
print(f"[WGDashboard][{datetime.now().strftime('%Y-%m-%d %H:%M:%S')}] Background Thread #1 Error: {str(e)}") print(f"[WGDashboard] Background Thread #1 Error: {str(e)}", flush=True)
time.sleep(10) time.sleep(10)
def peerJobScheduleBackgroundThread(): def peerJobScheduleBackgroundThread():
with app.app_context(): with app.app_context():
print(f"[WGDashboard][{datetime.now().strftime('%Y-%m-%d %H:%M:%S')}] Background Thread #2 Started") print(f"[WGDashboard] Background Thread #2 Started", flush=True)
time.sleep(10) time.sleep(10)
while True: while True:
AllPeerJobs.runJob() AllPeerJobs.runJob()