This commit is contained in:
Noah Hilverling 2020-11-12 11:53:02 +01:00
parent 6535f064fe
commit 60b665c1fc
2 changed files with 13 additions and 3 deletions

View File

@ -856,13 +856,21 @@ void ApiListener::ApiTimerHandler()
}
for (const Endpoint::Ptr& endpoint : ConfigType::GetObjectsByType<Endpoint>()) {
if (!endpoint->GetConnected())
Log(LogCritical, "LOG-POSITION")
<< "Checking endpoint '" << endpoint->GetName() << "'";
if (!endpoint->GetConnected()) {
Log(LogCritical, "LOG-POSITION")
<< "Endpoint '" << endpoint->GetName() << "' is not connected";
continue;
}
double ts = endpoint->GetRemoteLogPosition();
if (ts == 0)
if (ts == 0) {
Log(LogCritical, "LOG-POSITION")
<< "LocalLogPosition is 0 for endpoint '" << endpoint->GetName() << "'";
continue;
}
Dictionary::Ptr lmessage = new Dictionary({
{ "jsonrpc", "2.0" },

View File

@ -265,6 +265,8 @@ void JsonRpcConnection::MessageHandler(const String& jsonString)
if (ts < m_Endpoint->GetRemoteLogPosition())
return;
Log(LogCritical, "LOG-POSITION")
<< "SetRemoteLogPosition to '" << ts << "' for endpoint '" << m_Endpoint->GetName() << "'";
m_Endpoint->SetRemoteLogPosition(ts);
}
@ -342,7 +344,7 @@ Value SetLogPositionHandler(const MessageOrigin::Ptr& origin, const Dictionary::
endpoint->SetLocalLogPosition(log_position);
Log(LogCritical, "LOG-POSITION")
<< "Got SetLogPosition with timestamp '" << log_position << "' from endpoint '" << endpoint->GetName() << "'";
<< "Got SetLocalLogPosition with timestamp '" << log_position << "' from endpoint '" << endpoint->GetName() << "'";
return Empty;
}