Sentry: Fix compile error in AssertNotReachable, release version

This commit is contained in:
Lion Kortlepel 2021-08-11 23:53:30 +02:00 committed by Lion
parent c4b72be50a
commit 0f9a994c10
2 changed files with 3 additions and 9 deletions

View File

@ -66,11 +66,8 @@ inline void _assert([[maybe_unused]] const char* file, [[maybe_unused]] const ch
Sentry.LogAssert(#cond, _file_basename, _line, __func__); \
} \
} while (false)
#define AssertNotReachable() \
do { \
bool result = (cond); \
if (!result) { \
Sentry.LogAssert("code is unreachable", _file_basename, _line, __func__); \
} \
#define AssertNotReachable() \
do { \
Sentry.LogAssert("code is unreachable", _file_basename, _line, __func__); \
} while (false)
#endif // DEBUG

View File

@ -40,7 +40,6 @@ void THeartbeatThread::operator()() {
T = Http::POST(Application::GetBackendHostname(), Target, {}, Body, false, &ResponseCode);
if (T.substr(0, 2) != "20" || ResponseCode != 200) {
debug("response: " + T);
auto SentryReportError = [&](const std::string& transaction, int status) {
if (T != "YOU_SHALL_NOT_PASS") {
auto Lock = Sentry.CreateExclusiveContext();
@ -56,12 +55,10 @@ void THeartbeatThread::operator()() {
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) {
debug("response 1: " + T);
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) {
debug("response 2: " + T);
warn("Backend system refused server! Server might not show in the public list");
isAuth = false;
SentryReportError(Application::GetBackup2Hostname() + Target, ResponseCode);