]> granicus.if.org Git - icinga2/commitdiff
ApiListener#ApiTimerHandler(): delete all replayed logs 7126/head
authorAlexander A. Klimov <alexander.klimov@icinga.com>
Wed, 17 Apr 2019 11:52:13 +0000 (13:52 +0200)
committerAlexander A. Klimov <alexander.klimov@icinga.com>
Thu, 18 Apr 2019 15:00:40 +0000 (17:00 +0200)
refs #6932

lib/remote/apilistener.cpp

index 4d788610f1f63f34858834c598c9f3b5c8283786..3a454debb487b30e09776a228fd901aee57dbc37 100644 (file)
@@ -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<Endpoint>()) {
                        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;