]> granicus.if.org Git - icinga2/commitdiff
fix object lock
authorMichael Friedrich <michael.friedrich@netways.de>
Thu, 18 Jul 2013 16:28:23 +0000 (18:28 +0200)
committerMichael Friedrich <michael.friedrich@netways.de>
Thu, 18 Jul 2013 16:28:23 +0000 (18:28 +0200)
lib/icinga/service-check.cpp

index 8677c8209644b4c746592b7145cd0ec31db169a7..ef9f2882e5a30a4cdb18a5ce0709b85f681a17d3 100644 (file)
@@ -470,9 +470,6 @@ void Service::ProcessCheckResult(const Dictionary::Ptr& cr)
 
        bool reachable = IsReachable();
 
-       if (!reachable)
-               SetLastStateUnreachable(Utility::GetTime());
-
        Host::Ptr host = GetHost();
        bool host_reachable = true;
 
@@ -525,6 +522,9 @@ void Service::ProcessCheckResult(const Dictionary::Ptr& cr)
                        SetLastStateUnknown(Utility::GetTime());
        }
 
+       if (!reachable)
+               SetLastStateUnreachable(Utility::GetTime());
+
        SetCurrentCheckAttempt(attempt);
 
        int state = cr->Get("state");