From cbc53db5c1d62dce91bf79aace4795ac03d8cceb Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Thu, 12 Sep 2013 16:36:18 +0200 Subject: [PATCH] checker: Fix incorrect wait time when first service is non-authoritative. --- components/checker/checkercomponent.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/components/checker/checkercomponent.cpp b/components/checker/checkercomponent.cpp index 392baf350..a2a5b023a 100644 --- a/components/checker/checkercomponent.cpp +++ b/components/checker/checkercomponent.cpp @@ -83,6 +83,12 @@ void CheckerComponent::CheckThreadProc(void) CheckTimeView::iterator it = idx.begin(); Service::Ptr service = *it; + if (!service->HasAuthority("checker")) { + idx.erase(it); + idx.insert(service); + continue; + } + if (!service->IsActive()) { idx.erase(it); continue; @@ -90,11 +96,6 @@ 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(); @@ -110,6 +111,7 @@ void CheckerComponent::CheckThreadProc(void) bool forced = service->GetForceNextCheck(); bool check = true; + bool authoritative = service->HasAuthority("checker"); if (!forced) { if (!service->GetEnableActiveChecks()) { -- 2.50.1