From fc58aaad20f4c2ba19a4c9198e2119fde24e021b Mon Sep 17 00:00:00 2001 From: Yulya Artyukhina Date: Tue, 24 Sep 2024 19:13:51 +0200 Subject: [PATCH] Merge main to dev (#5068) Co-authored-by: Joey Orlando Co-authored-by: GitHub Actions Co-authored-by: Joey Orlando Co-authored-by: Matias Bordese Co-authored-by: Vadim Stepanov Co-authored-by: Dominik Broj Co-authored-by: Michael Derynck Co-authored-by: Innokentii Konstantinov Co-authored-by: Ildar Iskhakov --- engine/apps/api/views/alert_group.py | 4 ++++ helm/oncall/Chart.yaml | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/engine/apps/api/views/alert_group.py b/engine/apps/api/views/alert_group.py index e59ab7aa86..8e9cf00516 100644 --- a/engine/apps/api/views/alert_group.py +++ b/engine/apps/api/views/alert_group.py @@ -332,6 +332,10 @@ def get_queryset(self, ignore_filtering_by_available_teams=False): alert_receive_channels_ids = list(alert_receive_channels_qs.values_list("id", flat=True)) queryset = AlertGroup.objects.filter(channel__in=alert_receive_channels_ids) + # This is a quick fix to speed up requests from mobile app by adding default `started_at` filter value + if not self.request.query_params.get("started_at"): + queryset = queryset.filter(started_at__gte=timezone.now() - timezone.timedelta(days=30)) + if self.action in ("list", "stats") and settings.ALERT_GROUPS_DISABLE_PREFER_ORDERING_INDEX: # workaround related to MySQL "ORDER BY LIMIT Query Optimizer Bug" # read more: https://hackmysql.com/infamous-order-by-limit-query-optimizer-bug/ diff --git a/helm/oncall/Chart.yaml b/helm/oncall/Chart.yaml index c3836dbbd8..a39062a80c 100644 --- a/helm/oncall/Chart.yaml +++ b/helm/oncall/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: oncall description: Developer-friendly incident response with brilliant Slack integration type: application -version: 1.9.22 -appVersion: v1.9.22 +version: 1.9.27 +appVersion: v1.9.27 dependencies: - name: cert-manager version: v1.8.0