Skip to content

Commit c4afe3f

Browse files
committed
limit query
1 parent 8122648 commit c4afe3f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/sentry/tasks/seer/night_shift.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,9 @@ def _fixability_score_strategy(
206206
"""
207207
all_candidates: list[_ScoredCandidate] = []
208208

209-
for project in projects:
209+
for project_id_batch in chunked(projects, 100):
210210
groups = Group.objects.filter(
211-
project_id=project.id,
211+
project_id__in=[p.id for p in project_id_batch],
212212
status=GroupStatus.UNRESOLVED,
213213
seer_autofix_last_triggered__isnull=True,
214214
seer_explorer_autofix_last_triggered__isnull=True,
@@ -221,7 +221,7 @@ def _fixability_score_strategy(
221221
all_candidates.append(
222222
_ScoredCandidate(
223223
group_id=group.id,
224-
project_id=project.id,
224+
project_id=group.project_id,
225225
fixability=group.seer_fixability_score or 0.0,
226226
times_seen=group.times_seen,
227227
severity=(group.priority or 0) / 75.0,

0 commit comments

Comments
 (0)