ScheduledDowntime::TimerProc(): Catch exceptions to make sure other downtimes are still created

This commit is contained in:
Noah Hilverling 2021-06-21 16:23:06 +02:00
parent 2cd9c1d902
commit f48ad574d7
1 changed files with 9 additions and 2 deletions

View File

@ -87,8 +87,15 @@ void ScheduledDowntime::Start(bool runtimeCreated)
void ScheduledDowntime::TimerProc()
{
for (const ScheduledDowntime::Ptr& sd : ConfigType::GetObjectsByType<ScheduledDowntime>()) {
if (sd->IsActive() && !sd->IsPaused())
sd->CreateNextDowntime();
if (sd->IsActive() && !sd->IsPaused()) {
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);
}
}
}
}