checker: Fix waiting for non-authoritative checks.

This commit is contained in:
Gunnar Beutner 2013-09-12 15:31:07 +02:00
parent 5cdf08c371
commit 7bc99d3860
1 changed files with 5 additions and 6 deletions

View File

@ -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()) {