Skip to content

Commit

Permalink
https://telecominfraproject.atlassian.net/browse/WIFI-13147
Browse files Browse the repository at this point in the history
Signed-off-by: stephb9959 <[email protected]>
  • Loading branch information
stephb9959 committed Nov 23, 2023
1 parent 45561de commit 6cfb0ae
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/AP_WS_Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,17 @@ namespace OpenWifi {
auto now = Utils::Now();

{
if (!Garbage_.empty()) {
Garbage_.clear();
{
std::lock_guard L1(WSServerMutex_);
if (!Garbage_.empty()) {
Garbage_.clear();
}
}

uint64_t total_connected_time = 0;

if(now-last_zombie_run > 60) {
if(now-last_zombie_run > 20) {
poco_information(Logger(), fmt::format("Garbage collecting..."));
std::vector<std::uint64_t> SessionsToRemove;
NumberOfConnectedDevices_ = 0;
NumberOfConnectingDevices_ = 0;
Expand Down Expand Up @@ -227,6 +231,7 @@ namespace OpenWifi {
AverageDeviceConnectionTime_ =
NumberOfConnectedDevices_ > 0 ? total_connected_time / NumberOfConnectedDevices_
: 0;
poco_information(Logger(), fmt::format("Garbage collecting done..."));
} else {
NumberOfConnectedDevices_ = SerialNumbers_.size();
AverageDeviceConnectionTime_ += 10;
Expand Down

0 comments on commit 6cfb0ae

Please sign in to comment.