From f632606d764a2d84296ea61aa05220401fe0b0c4 Mon Sep 17 00:00:00 2001 From: Lion Kortlepel Date: Tue, 14 Sep 2021 12:18:31 +0200 Subject: [PATCH] Heartbeat: Dont report 200 + INVALID_KEY to Sentry --- src/THeartbeatThread.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/THeartbeatThread.cpp b/src/THeartbeatThread.cpp index cbd5eb7..030fe8e 100644 --- a/src/THeartbeatThread.cpp +++ b/src/THeartbeatThread.cpp @@ -52,16 +52,16 @@ void THeartbeatThread::operator()() { int ResponseCode = -1; T = Http::POST(Application::GetBackendHostname(), Target, {}, Body, false, &ResponseCode); - if (T.substr(0, 2) != "20" || ResponseCode != 200) { + if ((T.substr(0, 2) != "20" && ResponseCode != 200) || ResponseCode != 200) { trace("got " + T + " from backend"); SentryReportError(Application::GetBackendHostname() + Target, ResponseCode); std::this_thread::sleep_for(std::chrono::milliseconds(500)); T = Http::POST(Application::GetBackup1Hostname(), Target, {}, Body, false, &ResponseCode); - if (T.substr(0, 2) != "20" || ResponseCode != 200) { + if ((T.substr(0, 2) != "20" && ResponseCode != 200) || ResponseCode != 200) { SentryReportError(Application::GetBackup1Hostname() + Target, ResponseCode); std::this_thread::sleep_for(std::chrono::milliseconds(500)); T = Http::POST(Application::GetBackup2Hostname(), Target, {}, Body, false, &ResponseCode); - if (T.substr(0, 2) != "20" || ResponseCode != 200) { + if ((T.substr(0, 2) != "20" && ResponseCode != 200) || ResponseCode != 200) { warn("Backend system refused server! Server will not show in the public server list."); isAuth = false; SentryReportError(Application::GetBackup2Hostname() + Target, ResponseCode);