MCPcopy Create free account
hub / github.com/Icinga/icinga2 / CleanDeadlinedExecutions

Method CleanDeadlinedExecutions

lib/icinga/checkable.cpp:329–358  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

327}
328
329void Checkable::CleanDeadlinedExecutions(const Timer * const&)
330{
331 double now = Utility::GetTime();
332 Dictionary::Ptr executions;
333 Dictionary::Ptr execution;
334
335 for (auto& host : ConfigType::GetObjectsByType<Host>()) {
336 executions = host->GetExecutions();
337 if (executions) {
338 for (const String& key : executions->GetKeys()) {
339 execution = executions->Get(key);
340 if (execution->Contains("deadline") && now > execution->Get("deadline")) {
341 executions->Remove(key);
342 }
343 }
344 }
345 }
346
347 for (auto& service : ConfigType::GetObjectsByType<Service>()) {
348 executions = service->GetExecutions();
349 if (executions) {
350 for (const String& key : executions->GetKeys()) {
351 execution = executions->Get(key);
352 if (execution->Contains("deadline") && now > execution->Get("deadline")) {
353 executions->Remove(key);
354 }
355 }
356 }
357 }
358}
359
360String Checkable::StateTypeToString(StateType type)
361{

Callers

nothing calls this directly

Calls 4

GetKeysMethod · 0.80
GetMethod · 0.45
ContainsMethod · 0.45
RemoveMethod · 0.45

Tested by

no test coverage detected