Merge pull request #6916 from Icinga/bugfix/retry-interval-zero

Don't allow retry_interval <= 0
This commit is contained in:
Michael Friedrich 2019-01-30 15:28:26 +01:00 committed by GitHub
commit eb155495f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -198,6 +198,14 @@ void Checkable::ValidateCheckInterval(const Lazy<double>& lvalue, const Validati
BOOST_THROW_EXCEPTION(ValidationError(this, { "check_interval" }, "Interval must be greater than 0."));
}
void Checkable::ValidateRetryInterval(const Lazy<double>& lvalue, const ValidationUtils& utils)
{
ObjectImpl<Checkable>::ValidateRetryInterval(lvalue, utils);
if (lvalue() <= 0)
BOOST_THROW_EXCEPTION(ValidationError(this, { "retry_interval" }, "Interval must be greater than 0."));
}
void Checkable::ValidateMaxCheckAttempts(const Lazy<int>& lvalue, const ValidationUtils& utils)
{
ObjectImpl<Checkable>::ValidateMaxCheckAttempts(lvalue, utils);

View File

@ -192,6 +192,7 @@ public:
std::vector<intrusive_ptr<Dependency> > GetReverseDependencies() const;
void ValidateCheckInterval(const Lazy<double>& lvalue, const ValidationUtils& value) final;
void ValidateRetryInterval(const Lazy<double>& lvalue, const ValidationUtils& value) final;
void ValidateMaxCheckAttempts(const Lazy<int>& lvalue, const ValidationUtils& value) final;
static void IncreasePendingChecks();