File tree 2 files changed +15
-24
lines changed
2 files changed +15
-24
lines changed Original file line number Diff line number Diff line change @@ -65,22 +65,17 @@ def derive_code_mappings(
65
65
return
66
66
67
67
trees = {}
68
- if not dry_run :
69
- trees = installation .get_trees_for_org ()
70
- else :
71
- # Acquire the lock for a maximum of 10 minutes
72
- lock = locks .get (
73
- key = f"get_trees_for_org:{ org .slug } " , duration = 60 * 10 , name = "process_pending"
74
- )
68
+ # Acquire the lock for a maximum of 10 minutes
69
+ lock = locks .get (key = f"get_trees_for_org:{ org .slug } " , duration = 60 * 10 , name = "process_pending" )
75
70
76
- try :
77
- with lock .acquire ():
78
- trees = installation .get_trees_for_org (3600 * 3 )
79
- except UnableToAcquireLock as error :
80
- extra ["error" ] = error
81
- logger .warning ("derive_code_mappings.getting_lock_failed" , extra = extra )
82
- # This will cause the auto-retry logic to try again
83
- raise error
71
+ try :
72
+ with lock .acquire ():
73
+ trees = installation .get_trees_for_org (3600 * 3 )
74
+ except UnableToAcquireLock as error :
75
+ extra ["error" ] = error
76
+ logger .warning ("derive_code_mappings.getting_lock_failed" , extra = extra )
77
+ # This will cause the auto-retry logic to try again
78
+ raise error
84
79
85
80
trees_helper = CodeMappingTreesHelper (trees )
86
81
code_mappings = trees_helper .generate_code_mappings (stacktrace_paths )
Original file line number Diff line number Diff line change @@ -623,17 +623,13 @@ def process_code_mappings(job: PostProcessJob) -> None:
623
623
if project_queued :
624
624
return
625
625
626
- org_slug = project .organization .slug
626
+ org = event .project .organization
627
+ org_slug = org .slug
627
628
next_time = timezone .now () + timedelta (hours = 1 )
628
- has_normal_run_flag = features .has (
629
- "organizations:derive-code-mappings" , event .project .organization
630
- )
631
- has_dry_run_flag = features .has (
632
- "organizations:derive-code-mappings-dry-run" , event .project .organization
633
- )
629
+ has_normal_run_flag = features .has ("organizations:derive-code-mappings" , org )
630
+ has_dry_run_flag = features .has ("organizations:derive-code-mappings-dry-run" , org )
634
631
635
- # Right now EA orgs have both flags on, thus, only supporting dry run
636
- if has_normal_run_flag and event .data ["platform" ] == "python" :
632
+ if has_normal_run_flag :
637
633
logger .info (
638
634
f"derive_code_mappings: Queuing code mapping derivation for { project .slug = } { event .group_id = } ."
639
635
+ f" Future events in { org_slug = } will not have not have code mapping derivation until { next_time } "
You can’t perform that action at this time.
0 commit comments