On ScheduledDowntime change: ignore downtimes created before change

... while creating new downtimes.

refs #8309
This commit is contained in:
Alexander A. Klimov 2021-05-19 12:51:31 +02:00
parent 1ee26ac89e
commit bcc3870f3a
1 changed files with 5 additions and 0 deletions

View File

@ -240,11 +240,16 @@ void ScheduledDowntime::CreateNextDowntime()
}
double minEnd = 0;
auto downtimeOptionsHash (HashDowntimeOptions());
for (const Downtime::Ptr& downtime : GetCheckable()->GetDowntimes()) {
if (downtime->GetScheduledBy() != GetName())
continue;
auto configOwnerHash (downtime->GetConfigOwnerHash());
if (!configOwnerHash.IsEmpty() && configOwnerHash != downtimeOptionsHash)
continue;
double end = downtime->GetEndTime();
if (end > minEnd)
minEnd = end;