Skip to content

Commit 2afc4f8

Browse files
committed
fix(workflows): add detector group caching in ensure_association_with_detector
1 parent 7f90d00 commit 2afc4f8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/sentry/workflow_engine/processors/detector.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,8 +636,11 @@ def ensure_association_with_detector(group: Group, detector_id: int | None = Non
636636
return False
637637

638638
# Common case: it exists, we verify and move on.
639-
if DetectorGroup.objects.filter(group_id=group.id).exists():
639+
try:
640+
DetectorGroup.objects.get_from_cache(group_id=group.id)
640641
return True
642+
except DetectorGroup.DoesNotExist:
643+
pass
641644

642645
# Association is missing, determine the detector_id if not provided
643646
if detector_id is None:

0 commit comments

Comments
 (0)