fix: exception hanging & cache setting

1. Removed unhandled exceptions
2. Set cache value to dict
This commit is contained in:
AlexsanderHamir 2025-09-16 15:49:35 -07:00
parent df73593adc
commit 61463a43b1
2 changed files with 4 additions and 4 deletions

View file

@ -72,7 +72,7 @@ def _save_stats(profile_file: PathLib) -> None:
# Make sure profiler is re-enabled even if there's an error
try:
_profiler.enable()
except:
except Exception:
pass
@ -101,7 +101,7 @@ def profile_endpoint(sampling_rate: float = 1.0):
if is_sampling:
_save_stats(file_path_obj)
return result
except Exception as e:
except Exception:
if is_sampling:
_save_stats(file_path_obj)
raise
@ -117,7 +117,7 @@ def profile_endpoint(sampling_rate: float = 1.0):
if is_sampling:
_save_stats(file_path_obj)
return result
except Exception as e:
except Exception:
if is_sampling:
_save_stats(file_path_obj)
raise

View file

@ -48,7 +48,7 @@ async def test_get_end_user_object(customer_spend, customer_budget):
)
_cache = DualCache()
_key = "end_user_id:{}".format(end_user_id)
_cache.set_cache(key=_key, value=end_user_obj)
_cache.set_cache(key=_key, value=end_user_obj.model_dump())
try:
await get_end_user_object(
end_user_id=end_user_id,