Fix: Cluster log files were not properly removed when an instance has no peers.

This commit is contained in:
Gunnar Beutner 2013-09-16 11:08:13 +02:00
parent 5495b0279e
commit e391fc0858
1 changed files with 28 additions and 29 deletions

View File

@ -519,9 +519,7 @@ void ClusterComponent::ClusterTimerHandler(void)
Array::Ptr peers = GetPeers();
if (!peers)
return;
if (peers) {
ObjectLock olock(peers);
BOOST_FOREACH(const String& peer, peers) {
Endpoint::Ptr endpoint = Endpoint::GetByName(peer);
@ -555,6 +553,7 @@ void ClusterComponent::ClusterTimerHandler(void)
Log(LogWarning, "cluster", msgbuf.str());
}
}
}
std::vector<int> files;
Utility::Glob(GetClusterDir() + "log/*", boost::bind(&ClusterComponent::LogGlobHandler, boost::ref(files), _1));