mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-01 02:44:28 +02:00
Fix: Cluster log files were not properly removed when an instance has no peers.
This commit is contained in:
parent
5495b0279e
commit
e391fc0858
@ -519,9 +519,7 @@ void ClusterComponent::ClusterTimerHandler(void)
|
|||||||
|
|
||||||
Array::Ptr peers = GetPeers();
|
Array::Ptr peers = GetPeers();
|
||||||
|
|
||||||
if (!peers)
|
if (peers) {
|
||||||
return;
|
|
||||||
|
|
||||||
ObjectLock olock(peers);
|
ObjectLock olock(peers);
|
||||||
BOOST_FOREACH(const String& peer, peers) {
|
BOOST_FOREACH(const String& peer, peers) {
|
||||||
Endpoint::Ptr endpoint = Endpoint::GetByName(peer);
|
Endpoint::Ptr endpoint = Endpoint::GetByName(peer);
|
||||||
@ -555,6 +553,7 @@ void ClusterComponent::ClusterTimerHandler(void)
|
|||||||
Log(LogWarning, "cluster", msgbuf.str());
|
Log(LogWarning, "cluster", msgbuf.str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<int> files;
|
std::vector<int> files;
|
||||||
Utility::Glob(GetClusterDir() + "log/*", boost::bind(&ClusterComponent::LogGlobHandler, boost::ref(files), _1));
|
Utility::Glob(GetClusterDir() + "log/*", boost::bind(&ClusterComponent::LogGlobHandler, boost::ref(files), _1));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user