mirror of https://github.com/Icinga/icinga2.git
Merge pull request #8848 from Icinga/bugfix/harden-scheduled-downtimes
ScheduledDowntime::TimerProc(): Catch exceptions to make sure other downtimes are still created
This commit is contained in:
commit
5fdfd47176
|
@ -87,8 +87,15 @@ void ScheduledDowntime::Start(bool runtimeCreated)
|
||||||
void ScheduledDowntime::TimerProc()
|
void ScheduledDowntime::TimerProc()
|
||||||
{
|
{
|
||||||
for (const ScheduledDowntime::Ptr& sd : ConfigType::GetObjectsByType<ScheduledDowntime>()) {
|
for (const ScheduledDowntime::Ptr& sd : ConfigType::GetObjectsByType<ScheduledDowntime>()) {
|
||||||
if (sd->IsActive() && !sd->IsPaused())
|
if (sd->IsActive() && !sd->IsPaused()) {
|
||||||
sd->CreateNextDowntime();
|
try {
|
||||||
|
sd->CreateNextDowntime();
|
||||||
|
} catch (const std::exception& ex) {
|
||||||
|
Log(LogCritical, "ScheduledDowntime")
|
||||||
|
<< "Exception occurred during creation of next downtime for scheduled downtime '"
|
||||||
|
<< sd->GetName() << "': " << DiagnosticInformation(ex, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue