Move activeConnections to Server
This commit is contained in:
@@ -17,8 +17,6 @@
|
||||
#include <unistd.h>
|
||||
#include <vector>
|
||||
|
||||
extern std::atomic<int> activeConnections;
|
||||
|
||||
std::shared_ptr<Server> Server::create(const weaseldb::Config &config,
|
||||
ConnectionHandler &handler) {
|
||||
// Use std::shared_ptr constructor with private access
|
||||
@@ -407,7 +405,7 @@ void Server::start_io_threads(std::vector<std::thread> &threads) {
|
||||
|
||||
// Check connection limit
|
||||
if (config_.server.max_connections > 0 &&
|
||||
activeConnections.load(std::memory_order_relaxed) >=
|
||||
active_connections_.load(std::memory_order_relaxed) >=
|
||||
config_.server.max_connections) {
|
||||
close(fd);
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user