mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-07 08:26:10 +00:00
fix: also close sync clients on eviction from LLMClientCache
This commit is contained in:
parent
d6c6d12549
commit
bfeed0e590
1 changed files with 5 additions and 0 deletions
|
|
@ -21,6 +21,11 @@ class LLMClientCache(InMemoryCache):
|
||||||
asyncio.get_running_loop().create_task(close_fn())
|
asyncio.get_running_loop().create_task(close_fn())
|
||||||
except RuntimeError:
|
except RuntimeError:
|
||||||
pass
|
pass
|
||||||
|
elif close_fn and callable(close_fn):
|
||||||
|
try:
|
||||||
|
close_fn()
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
|
||||||
def update_cache_key_with_event_loop(self, key):
|
def update_cache_key_with_event_loop(self, key):
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue