mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-08 03:08:45 +00:00
fix: exception hanging & cache setting
1. Removed unhandled exceptions 2. Set cache value to dict
This commit is contained in:
parent
df73593adc
commit
61463a43b1
2 changed files with 4 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue