fix incorrect variable type (this should have been a signed int);

pull/85/head
Bryan Biedenkapp 10 months ago
parent 2b8c7d4c91
commit b21f956bf9

@ -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. */

@ -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

Loading…
Cancel
Save

Powered by TurnKey Linux.