mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-09 03:18:44 +00:00
fix(logging_worker): bound flush-rescued coroutines with the worker timeout
This commit is contained in:
parent
c769562b5f
commit
a4834cbbf5
1 changed files with 2 additions and 3 deletions
|
|
@ -76,10 +76,9 @@ class LoggingWorker:
|
|||
if inspect.getcoroutinestate(task["coroutine"]) == inspect.CORO_CREATED
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def _run_coroutine_silently(loop: asyncio.AbstractEventLoop, coroutine: Coroutine) -> bool:
|
||||
def _run_coroutine_silently(self, loop: asyncio.AbstractEventLoop, coroutine: Coroutine) -> bool:
|
||||
try:
|
||||
loop.run_until_complete(coroutine)
|
||||
loop.run_until_complete(asyncio.wait_for(coroutine, timeout=self.timeout))
|
||||
except Exception: # noqa: BLE001 # atexit flush must never break the user's program
|
||||
return False
|
||||
return True
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue