File tree Expand file tree Collapse file tree 1 file changed +14
-12
lines changed
src/sentry/dynamic_sampling Expand file tree Collapse file tree 1 file changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -84,15 +84,17 @@ def adjust_sample_rates(
8484 ds_projects = model .adjust_sample_rates ()
8585
8686 redis_client = get_redis_client_for_ds ()
87- for ds_project in ds_projects :
88- # hash, key, value
89- cache_key = _generate_cache_key (org_id = org_id )
90- redis_client .hset (
91- cache_key ,
92- ds_project .id ,
93- ds_project .new_sample_rate , # redis stores is as string
94- )
95- redis_client .pexpire (cache_key , CACHE_KEY_TTL )
96- schedule_invalidate_project_config (
97- project_id = ds_project .id , trigger = "dynamic_sampling_prioritise_project_bias"
98- )
87+ with redis_client .pipeline (transaction = False ) as pipeline :
88+ for ds_project in ds_projects :
89+ # hash, key, value
90+ cache_key = _generate_cache_key (org_id = org_id )
91+ pipeline .hset (
92+ cache_key ,
93+ ds_project .id ,
94+ ds_project .new_sample_rate , # redis stores is as string
95+ )
96+ pipeline .pexpire (cache_key , CACHE_KEY_TTL )
97+ schedule_invalidate_project_config (
98+ project_id = ds_project .id , trigger = "dynamic_sampling_prioritise_project_bias"
99+ )
100+ pipeline .execute ()
You can’t perform that action at this time.
0 commit comments