diff --git a/fm/models/alarmescalation.py b/fm/models/alarmescalation.py index f6bbd6fe175a374e2a585414da5bb1d48ea15fe9..b3d995a37074797d84b763cd00c9462fce4fd214 100644 --- a/fm/models/alarmescalation.py +++ b/fm/models/alarmescalation.py @@ -135,7 +135,15 @@ class AlarmEscalation(Document): continue logger.debug("[%s] Watch for %s after %s seconds", alarm.id, esc.name, e_item.delay) et = alarm.timestamp + datetime.timedelta(seconds=e_item.delay) - if et > now: + if timestamp_policy == "c": + # If escalation with current timestamp - shift consequence after main escalation + delay = max((et - now).total_seconds(), 120) if et > now else 120 + logger.info( + "[%s] Watch escalation with create new timestamp policy, after %s seconds", + alarm.id, + delay, + ) + elif et > now: delay = (et - now).total_seconds() else: delay = None