Fix lag calculation for the 'cluster-zone' check

This commit is contained in:
Gunnar Beutner 2015-03-03 14:40:05 +01:00
parent 3615716983
commit c9c7f9bed1
1 changed files with 4 additions and 6 deletions

View File

@ -86,13 +86,11 @@ void ClusterZoneCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const Che
BOOST_FOREACH(const Endpoint::Ptr& endpoint, zone->GetEndpoints()) {
double eplag = Utility::GetTime() - endpoint->GetRemoteLogPosition();
if (eplag > lag)
lag = eplag;
if (endpoint->IsConnected()) {
if (endpoint->IsConnected())
connected = true;
break;
}
if ((endpoint->GetSyncing() || !endpoint->IsConnected()) && eplag > lag)
lag = eplag;
}
if (!connected) {