* E.g. we're going to re-send a stashed problem notification as *this is still not ok. * But if the next check result recovers *this soon, we would send a recovery notification soon after the problem one. * This is not desired, especially for lots of checkables at once. * Because of that if there's likely to be a check result soon, * we delay the re-sending of the stashed notification until th
| 316 | * @return Whether *this is likely to be checked soon |
| 317 | */ |
| 318 | bool Checkable::IsLikelyToBeCheckedSoon() |
| 319 | { |
| 320 | if (!GetEnableActiveChecks()) { |
| 321 | return false; |
| 322 | } |
| 323 | |
| 324 | // One minute unless the check interval is too short so the next check will always run during the next minute. |
| 325 | auto threshold (GetCheckInterval() - 10); |
| 326 | |
| 327 | if (threshold > 60) { |
| 328 | threshold = 60; |
| 329 | } else if (threshold < 0) { |
| 330 | threshold = 0; |
| 331 | } |
| 332 | |
| 333 | return GetNextCheck() <= Utility::GetTime() + threshold; |
| 334 | } |
no outgoing calls
no test coverage detected