| 327 | } |
| 328 | |
| 329 | void 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 | |
| 360 | String Checkable::StateTypeToString(StateType type) |
| 361 | { |