From: Gunnar Beutner Date: Thu, 12 Sep 2013 13:31:07 +0000 (+0200) Subject: checker: Fix waiting for non-authoritative checks. X-Git-Tag: v0.0.3~536 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7bc99d38602114a753718bad7684d04c24dcfd03;p=icinga2 checker: Fix waiting for non-authoritative checks. --- diff --git a/components/checker/checkercomponent.cpp b/components/checker/checkercomponent.cpp index 84770f6a2..392baf350 100644 --- a/components/checker/checkercomponent.cpp +++ b/components/checker/checkercomponent.cpp @@ -90,6 +90,11 @@ void CheckerComponent::CheckThreadProc(void) double wait = service->GetNextCheck() - Utility::GetTime(); + bool authoritative = service->HasAuthority("checker"); + + if (!authoritative) + wait = 60; + if (wait > 0) { /* Make sure the service we just examined can be destroyed while we're waiting. */ service.reset(); @@ -105,12 +110,6 @@ void CheckerComponent::CheckThreadProc(void) bool forced = service->GetForceNextCheck(); bool check = true; - bool authoritative = service->HasAuthority("checker"); - - if (!authoritative) { - Log(LogDebug, "checker", "Skipping check for service '" + service->GetName() + "': not authoritative"); - check = false; - } if (!forced) { if (!service->GetEnableActiveChecks()) {