Merge pull request #6719 from Icinga/fix/finished-reconnect-message

Do not send 'finished reconnecting...' if failed
This commit is contained in:
Michael Friedrich 2018-10-24 11:51:34 +02:00 committed by GitHub
commit 6de4cef3ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -421,6 +421,8 @@ void ApiListener::AddConnection(const Endpoint::Ptr& endpoint)
NewClientHandler(client, endpoint->GetName(), RoleClient); NewClientHandler(client, endpoint->GetName(), RoleClient);
endpoint->SetConnecting(false); endpoint->SetConnecting(false);
Log(LogInformation, "ApiListener")
<< "Finished reconnecting to endpoint '" << endpoint->GetName() << "' via host '" << host << "' and port '" << port << "'";
} catch (const std::exception& ex) { } catch (const std::exception& ex) {
endpoint->SetConnecting(false); endpoint->SetConnecting(false);
client->Close(); client->Close();
@ -431,9 +433,6 @@ void ApiListener::AddConnection(const Endpoint::Ptr& endpoint)
Log(LogDebug, "ApiListener") Log(LogDebug, "ApiListener")
<< info.str() << "\n" << DiagnosticInformation(ex); << info.str() << "\n" << DiagnosticInformation(ex);
} }
Log(LogInformation, "ApiListener")
<< "Finished reconnecting to endpoint '" << endpoint->GetName() << "' via host '" << host << "' and port '" << port << "'";
} }
void ApiListener::NewClientHandler(const Socket::Ptr& client, const String& hostname, ConnectionRole role) void ApiListener::NewClientHandler(const Socket::Ptr& client, const String& hostname, ConnectionRole role)