From b21f956bf92c459b2efced62251049bf7202c4f2 Mon Sep 17 00:00:00 2001 From: Bryan Biedenkapp Date: Wed, 16 Apr 2025 10:09:59 -0400 Subject: [PATCH] fix incorrect variable type (this should have been a signed int); --- src/fne/network/influxdb/InfluxDB.cpp | 2 +- src/fne/network/influxdb/InfluxDB.h | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/fne/network/influxdb/InfluxDB.cpp b/src/fne/network/influxdb/InfluxDB.cpp index d7c0efa1..269fa112 100644 --- a/src/fne/network/influxdb/InfluxDB.cpp +++ b/src/fne/network/influxdb/InfluxDB.cpp @@ -29,7 +29,7 @@ using namespace network::influxdb; // Static Class Members // --------------------------------------------------------------------------- -uint32_t detail::TSCaller::m_currThreadCnt = 0U; +int32_t detail::TSCaller::m_currThreadCnt = 0U; /* Generates a InfluxDB REST API request. */ diff --git a/src/fne/network/influxdb/InfluxDB.h b/src/fne/network/influxdb/InfluxDB.h index 1af1babb..7c36ffcd 100644 --- a/src/fne/network/influxdb/InfluxDB.h +++ b/src/fne/network/influxdb/InfluxDB.h @@ -63,7 +63,7 @@ namespace network // Constants // --------------------------------------------------------------------------- - #define MAX_INFLUXQL_THREAD_CNT 75U // this is a really extreme number of pending queries... + #define MAX_INFLUXQL_THREAD_CNT 75 // this is a really extreme number of pending queries... // --------------------------------------------------------------------------- // Class Declaration @@ -430,6 +430,10 @@ namespace network int request(const ServerInfo& si, std::string* resp = nullptr) { return detail::inner::request("POST", "write", "", m_lines.str(), si, resp); } int requestAsync(const ServerInfo& si) { + if (m_currThreadCnt < 0) { + m_currThreadCnt = 0; + } + if (m_currThreadCnt >= MAX_INFLUXQL_THREAD_CNT) { ::LogError(LOG_HOST, "Maximum concurrent FluxQL thread count reached, dropping request!"); return 1; @@ -452,7 +456,7 @@ namespace network } private: - static uint32_t m_currThreadCnt; + static int32_t m_currThreadCnt; /** * @brief