From 9b489cf9b9347fbce5f5f268d83bba556467e2e9 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Wed, 17 Apr 2019 13:52:13 +0200 Subject: [PATCH] ApiListener#ApiTimerHandler(): delete all replayed logs refs #6932 --- lib/remote/apilistener.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/remote/apilistener.cpp b/lib/remote/apilistener.cpp index 4d788610f..3a454debb 100644 --- a/lib/remote/apilistener.cpp +++ b/lib/remote/apilistener.cpp @@ -741,11 +741,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; -- 2.40.0