diff --git a/cib/servicestatusmessage.cpp b/cib/servicestatusmessage.cpp index bfc468798..02c6a3f16 100644 --- a/cib/servicestatusmessage.cpp +++ b/cib/servicestatusmessage.cpp @@ -71,21 +71,6 @@ void ServiceStatusMessage::SetCurrentCheckAttempt(long attempt) Set("current_attempt", attempt); } -bool ServiceStatusMessage::GetNextCheck(time_t *ts) const -{ - long value; - if (Get("next_check", &value)) { - *ts = value; - return true; - } - return false; -} - -void ServiceStatusMessage::SetNextCheck(time_t ts) -{ - Set("next_check", static_cast(ts)); -} - bool ServiceStatusMessage::GetCheckResult(CheckResult *cr) const { Dictionary::Ptr obj; diff --git a/cib/servicestatusmessage.h b/cib/servicestatusmessage.h index 934074a37..74fca85a9 100644 --- a/cib/servicestatusmessage.h +++ b/cib/servicestatusmessage.h @@ -41,9 +41,6 @@ public: bool GetCurrentCheckAttempt(long *attempt) const; void SetCurrentCheckAttempt(long attempt); - bool GetNextCheck(time_t *ts) const; - void SetNextCheck(time_t ts); - bool GetCheckResult(CheckResult *cr) const; void SetCheckResult(CheckResult cr); }; diff --git a/components/checker/checkercomponent.cpp b/components/checker/checkercomponent.cpp index d77d06390..f4355efc3 100644 --- a/components/checker/checkercomponent.cpp +++ b/components/checker/checkercomponent.cpp @@ -104,9 +104,6 @@ void CheckerComponent::CheckCompletedHandler(Service service, const ScriptTask:: { service.RemoveTag("current_task"); - /* figure out when the next check is for this service */ - service.UpdateNextCheck(); - try { Variant vresult = task->GetResult(); @@ -124,7 +121,6 @@ void CheckerComponent::CheckCompletedHandler(Service service, const ScriptTask:: params.SetState(service.GetState()); params.SetStateType(service.GetStateType()); params.SetCurrentCheckAttempt(service.GetCurrentCheckAttempt()); - params.SetNextCheck(service.GetNextCheck()); params.SetCheckResult(result); rm.SetParams(params); @@ -138,6 +134,11 @@ void CheckerComponent::CheckCompletedHandler(Service service, const ScriptTask:: Logger::Write(LogWarning, "checker", msgbuf.str()); } + /* figure out when the next check is for this service; the local + * cibsync component should've already done this as part of processing + * the CheckResult message, but lets do it again to be sure */ + service.UpdateNextCheck(); + /* remove the service from the list of pending services; if it's not in the * list this was a manual (i.e. forced) check and we must not re-add the * service to the services list because it's already there. */ diff --git a/components/cibsync/cibsynccomponent.cpp b/components/cibsync/cibsynccomponent.cpp index b4badb2c2..de2d7098f 100644 --- a/components/cibsync/cibsynccomponent.cpp +++ b/components/cibsync/cibsynccomponent.cpp @@ -91,10 +91,6 @@ void CIBSyncComponent::ServiceStatusRequestHandler(const Endpoint::Ptr& sender, Service service = Service::GetByName(svcname); - time_t nextCheck; - if (params.GetNextCheck(&nextCheck)) - service.SetNextCheck(nextCheck); - ServiceState state; ServiceStateType stateType; if (params.GetState(&state) && params.GetStateType(&stateType)) { @@ -123,6 +119,8 @@ void CIBSyncComponent::ServiceStatusRequestHandler(const Endpoint::Ptr& sender, if (params.GetCheckResult(&cr)) service.SetLastCheckResult(cr); + service.UpdateNextCheck(); + time_t now; time(&now); CIB::UpdateTaskStatistics(now, 1);