mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-03 20:04:29 +02:00
checker: Fix incorrect wait time when first service is non-authoritative.
This commit is contained in:
parent
eb7d9e96f8
commit
cbc53db5c1
@ -83,6 +83,12 @@ void CheckerComponent::CheckThreadProc(void)
|
|||||||
CheckTimeView::iterator it = idx.begin();
|
CheckTimeView::iterator it = idx.begin();
|
||||||
Service::Ptr service = *it;
|
Service::Ptr service = *it;
|
||||||
|
|
||||||
|
if (!service->HasAuthority("checker")) {
|
||||||
|
idx.erase(it);
|
||||||
|
idx.insert(service);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (!service->IsActive()) {
|
if (!service->IsActive()) {
|
||||||
idx.erase(it);
|
idx.erase(it);
|
||||||
continue;
|
continue;
|
||||||
@ -90,11 +96,6 @@ void CheckerComponent::CheckThreadProc(void)
|
|||||||
|
|
||||||
double wait = service->GetNextCheck() - Utility::GetTime();
|
double wait = service->GetNextCheck() - Utility::GetTime();
|
||||||
|
|
||||||
bool authoritative = service->HasAuthority("checker");
|
|
||||||
|
|
||||||
if (!authoritative)
|
|
||||||
wait = 60;
|
|
||||||
|
|
||||||
if (wait > 0) {
|
if (wait > 0) {
|
||||||
/* Make sure the service we just examined can be destroyed while we're waiting. */
|
/* Make sure the service we just examined can be destroyed while we're waiting. */
|
||||||
service.reset();
|
service.reset();
|
||||||
@ -110,6 +111,7 @@ void CheckerComponent::CheckThreadProc(void)
|
|||||||
|
|
||||||
bool forced = service->GetForceNextCheck();
|
bool forced = service->GetForceNextCheck();
|
||||||
bool check = true;
|
bool check = true;
|
||||||
|
bool authoritative = service->HasAuthority("checker");
|
||||||
|
|
||||||
if (!forced) {
|
if (!forced) {
|
||||||
if (!service->GetEnableActiveChecks()) {
|
if (!service->GetEnableActiveChecks()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user