Exclude the latest alert groups from escalation finished check (#2913)

# What this PR does
Exclude the latest alert groups from escalation finished check to give
them time for building escalation snapshot

## Which issue(s) this PR fixes
https://github.com/grafana/oncall-private/issues/2028

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)
This commit is contained in:
Yulya Artyukhina 2023-08-30 11:28:09 +02:00 committed by GitHub
parent 0b509221a4
commit 4cff4f2fa9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -114,7 +114,7 @@ def check_escalation_finished_task() -> None:
"""
from apps.alerts.models import AlertGroup
now = timezone.now()
now = timezone.now() - datetime.timedelta(minutes=5)
two_days_ago = now - datetime.timedelta(days=2)
alert_groups = AlertGroup.objects.using(get_random_readonly_database_key_if_present_otherwise_default()).filter(