]> granicus.if.org Git - icinga2/commitdiff
Do not send 'finished reconnecting...' if failed 6719/head
authorNoah Hilverling <noah@hilverling.com>
Thu, 9 Aug 2018 06:29:27 +0000 (08:29 +0200)
committerNoah Hilverling <noah@hilverling.com>
Thu, 9 Aug 2018 06:29:27 +0000 (08:29 +0200)
lib/remote/apilistener.cpp

index c7ba834b4d168a93f52c8469237df20d82a69090..04ffe144917d58ad660e15782e6c9c59fcf095bc 100644 (file)
@@ -393,6 +393,8 @@ void ApiListener::AddConnection(const Endpoint::Ptr& endpoint)
                client->Connect(host, port);
                NewClientHandler(client, serverName, RoleClient);
                endpoint->SetConnecting(false);
+               Log(LogInformation, "ApiListener")
+                               << "Finished reconnecting to endpoint '" << endpoint->GetName() << "' via host '" << host << "' and port '" << port << "'";
        } catch (const std::exception& ex) {
                endpoint->SetConnecting(false);
                client->Close();
@@ -403,9 +405,6 @@ void ApiListener::AddConnection(const Endpoint::Ptr& endpoint)
                Log(LogDebug, "ApiListener")
                        << 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)