From c15046f8b1ce7f4848511af9d4456087eec75c3e Mon Sep 17 00:00:00 2001 From: Lion Kortlepel Date: Wed, 17 Feb 2021 13:10:18 +0100 Subject: [PATCH] fix pps dying on startup :^) --- src/TPPSMonitor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/TPPSMonitor.cpp b/src/TPPSMonitor.cpp index fcdad39..e817fbf 100644 --- a/src/TPPSMonitor.cpp +++ b/src/TPPSMonitor.cpp @@ -23,10 +23,11 @@ void TPPSMonitor::operator()() { info("PPSMonitor starting"); std::vector> TimedOutClients; while (!mShutdown) { + std::this_thread::sleep_for(std::chrono::seconds(1)); int C = 0, V = 0; if (mServer.ClientCount() == 0) { Application::SetPPS("-"); - return; + continue; } mServer.ForEachClient([&](std::weak_ptr ClientPtr) -> bool { if (!ClientPtr.expired()) { @@ -53,6 +54,5 @@ void TPPSMonitor::operator()() { Application::SetPPS(std::to_string(R)); } mInternalPPS = 0; - std::this_thread::sleep_for(std::chrono::seconds(1)); } }