From 9d9f1ded9a27476aefee98f8c0084e66de4983f9 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Thu, 20 Jun 2024 17:57:23 +0200 Subject: [PATCH] Checkable#UpdateNextCheck(): allow to suppress next_check listeners --- lib/icinga/checkable-check.cpp | 4 ++-- lib/icinga/checkable.hpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/icinga/checkable-check.cpp b/lib/icinga/checkable-check.cpp index f0af81bdd96..2bbc4df4ccc 100644 --- a/lib/icinga/checkable-check.cpp +++ b/lib/icinga/checkable-check.cpp @@ -49,7 +49,7 @@ long Checkable::GetSchedulingOffset() return m_SchedulingOffset; } -void Checkable::UpdateNextCheck(const MessageOrigin::Ptr& origin) +void Checkable::UpdateNextCheck(const MessageOrigin::Ptr& origin, bool suppressEvents) { double interval; @@ -75,7 +75,7 @@ void Checkable::UpdateNextCheck(const MessageOrigin::Ptr& origin) << "' from last check time at " << Utility::FormatDateTime("%Y-%m-%d %H:%M:%S %z", (lastCheck < 0 ? 0 : lastCheck)) << " (" << GetLastCheck() << ") to next check time at " << Utility::FormatDateTime("%Y-%m-%d %H:%M:%S %z", nextCheck) << " (" << nextCheck << ")."; - SetNextCheck(nextCheck, false, origin); + SetNextCheck(nextCheck, suppressEvents, origin); } bool Checkable::HasBeenChecked() const diff --git a/lib/icinga/checkable.hpp b/lib/icinga/checkable.hpp index fcfbca9b281..c943458f964 100644 --- a/lib/icinga/checkable.hpp +++ b/lib/icinga/checkable.hpp @@ -99,7 +99,7 @@ class Checkable : public ObjectImpl long GetSchedulingOffset(); void SetSchedulingOffset(long offset); - void UpdateNextCheck(const MessageOrigin::Ptr& origin = nullptr); + void UpdateNextCheck(const MessageOrigin::Ptr& origin = nullptr, bool suppressEvents = false); bool HasBeenChecked() const; virtual bool IsStateOK(ServiceState state) const = 0;