1
0
mirror of https://github.com/Icinga/icinga2.git synced 2025-04-08 17:05:25 +02:00

Merge pull request from Icinga/bugfix/replay-logs-6932

ApiListener#ApiTimerHandler(): delete all replayed logs
This commit is contained in:
Michael Friedrich 2019-04-23 12:07:02 +02:00 committed by GitHub
commit 5fb191bbeb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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;