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<long>(ts));
-}
-
bool ServiceStatusMessage::GetCheckResult(CheckResult *cr) const
{
Dictionary::Ptr obj;
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);
};
{
service.RemoveTag("current_task");
- /* figure out when the next check is for this service */
- service.UpdateNextCheck();
-
try {
Variant vresult = task->GetResult();
params.SetState(service.GetState());
params.SetStateType(service.GetStateType());
params.SetCurrentCheckAttempt(service.GetCurrentCheckAttempt());
- params.SetNextCheck(service.GetNextCheck());
params.SetCheckResult(result);
rm.SetParams(params);
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. */
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)) {
if (params.GetCheckResult(&cr))
service.SetLastCheckResult(cr);
+ service.UpdateNextCheck();
+
time_t now;
time(&now);
CIB::UpdateTaskStatistics(now, 1);