Skip to content

Commit

Permalink
use helper to get grouphashes
Browse files Browse the repository at this point in the history
  • Loading branch information
lobsterkatie committed Aug 15, 2024
1 parent 8f0b4c8 commit 5f1474c
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/sentry/event_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
find_existing_grouphash,
find_existing_grouphash_new,
get_hash_values,
get_or_create_grouphashes,
maybe_run_background_grouping,
maybe_run_secondary_grouping,
run_primary_grouping,
Expand Down Expand Up @@ -1420,9 +1421,7 @@ def _save_aggregate(
and not primary_hashes.hierarchical_hashes
)

flat_grouphashes = [
GroupHash.objects.get_or_create(project=project, hash=hash)[0] for hash in hashes.hashes
]
flat_grouphashes = get_or_create_grouphashes(project, hashes)

# The root_hierarchical_hash is the least specific hash within the tree, so
# typically hierarchical_hashes[0], unless a hash `n` has been split in
Expand Down Expand Up @@ -1788,10 +1787,7 @@ def get_hashes_and_grouphashes(
grouping_config, hashes = hash_calculation_function(project, job, metric_tags)

if extract_hashes(hashes):
grouphashes = [
GroupHash.objects.get_or_create(project=project, hash=hash)[0]
for hash in extract_hashes(hashes)
]
grouphashes = get_or_create_grouphashes(project, hashes)

existing_grouphash = find_existing_grouphash_new(grouphashes)

Expand Down

0 comments on commit 5f1474c

Please sign in to comment.