File tree 2 files changed +11
-1
lines changed
src/sentry/workflow_engine/processors
tests/sentry/workflow_engine/processors
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,9 @@ def process_data_sources(
21
21
# Fetch all data sources and associated detectors for the given data packets
22
22
with sentry_sdk .start_span (op = "workflow_engine.process_data_sources.fetch_data_sources" ):
23
23
data_sources = DataSource .objects .filter (
24
- source_id__in = data_packet_ids , type = query_type
24
+ source_id__in = data_packet_ids ,
25
+ type = query_type ,
26
+ detectors__enabled = True ,
25
27
).prefetch_related (Prefetch ("detectors" ))
26
28
27
29
# Build a lookup dict for source_id to detectors
Original file line number Diff line number Diff line change @@ -52,6 +52,14 @@ def test_multiple_data_packets(self):
52
52
(self .packet_two , [self .detector_two ]),
53
53
]
54
54
55
+ def test_disabled_detector (self ):
56
+ self .detector_one .enabled = False
57
+ self .detector_one .save ()
58
+
59
+ assert process_data_sources (self .data_packets , "test" ) == [
60
+ (self .packet_two , [self .detector_two ])
61
+ ]
62
+
55
63
def test_multiple_detectors (self ):
56
64
self .detector_three = self .create_detector (name = "test_detector3" )
57
65
self .detector_four = self .create_detector (name = "test_detector4" )
You can’t perform that action at this time.
0 commit comments