From: Alexander A. Klimov Date: Wed, 17 Apr 2019 11:52:13 +0000 (+0200) Subject: ApiListener#ApiTimerHandler(): delete all replayed logs X-Git-Tag: v2.10.5~13 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=511772e08a707abe28ddade709a20b78c496e41f;p=icinga2 ApiListener#ApiTimerHandler(): delete all replayed logs refs #6932 (cherry picked from commit 9b489cf9b9347fbce5f5f268d83bba556467e2e9) --- diff --git a/lib/remote/apilistener.cpp b/lib/remote/apilistener.cpp index fb2443d0c..fd2d95cf0 100644 --- a/lib/remote/apilistener.cpp +++ b/lib/remote/apilistener.cpp @@ -694,11 +694,19 @@ void ApiListener::ApiTimerHandler() for (int ts : files) { bool need = false; + auto localZone (GetLocalEndpoint()->GetZone()); for (const Endpoint::Ptr& endpoint : ConfigType::GetObjectsByType()) { if (endpoint == GetLocalEndpoint()) continue; + auto zone (endpoint->GetZone()); + + /* only care for endpoints in a) the same zone b) our parent zone c) immediate child zones */ + if (!(zone == localZone || zone == localZone->GetParent() || zone->GetParent() == localZone)) { + continue; + } + if (endpoint->GetLogDuration() >= 0 && ts < now - endpoint->GetLogDuration()) continue;