From 503037c7e2d4c1ae20929e8a65615f9ed8837640 Mon Sep 17 00:00:00 2001 From: cppla Date: Wed, 3 Apr 2024 19:53:04 +0800 Subject: [PATCH] add two logs --- docker-compose.yml | 1 - server/src/main.cpp | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 5b935d2..42f8e12 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -24,7 +24,6 @@ services: networks: serverstatus-network: - name: serverstatus-network ipam: config: - subnet: 172.23.0.0/24 diff --git a/server/src/main.cpp b/server/src/main.cpp index 743fe91..6b318da 100644 --- a/server/src/main.cpp +++ b/server/src/main.cpp @@ -543,7 +543,7 @@ void CMain::offlineAlarmThread(void *pUser) time_t currentStamp = (long long)time(/*ago*/0); if ((currentStamp-pClients->m_AlarmLastTime) > pWatchDogs[ID].m_aInterval) { - printf("客户端下线, Client disconnects and sends alert information\n"); + printf("客户端下线且超过阈值, Client disconnects and sends alert information\n"); pClients->m_AlarmLastTime = currentStamp; CURL *curl; CURLcode res; @@ -588,6 +588,8 @@ void CMain::offlineAlarmThread(void *pUser) } curl_global_cleanup(); } + else + printf("客户端下线但未超过阈值,No alarm if the threshold is not exceeded\n"); } ID++; } @@ -596,6 +598,7 @@ void CMain::offlineAlarmThread(void *pUser) { printf("网络波动,No alarm information is sent due to network fluctuations\n"); } + fflush(stdout); } int CMain::ReadConfig()