Skip to content

Commit 8424cd1

Browse files
authored
fix(db): Avoid project db query by accessing just its id (#104008)
The attribute access in `group.project.id` results in unnecessary db query and since we need only project id which is already present on the Group model we can just access it directly.
1 parent e033a48 commit 8424cd1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/sentry/event_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1918,7 +1918,7 @@ def _process_existing_aggregate(
19181918
# We pass `times_seen` separately from all of the other columns so that `buffer_inr` knows to
19191919
# increment rather than overwrite the existing value
19201920
times_seen = 1
1921-
if group.project.id in options.get("issues.client_error_sampling.project_allowlist"):
1921+
if group.project_id in options.get("issues.client_error_sampling.project_allowlist"):
19221922
times_seen = _get_error_weighted_times_seen(event)
19231923

19241924
buffer_incr(Group, {"times_seen": times_seen}, {"id": group.id}, updated_group_values)

0 commit comments

Comments
 (0)