mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-10 22:41:41 +00:00
fix: add mypy type ignore for union-attr on callback.async_close
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
12e4ffa39c
commit
32c60e71cf
1 changed files with 2 additions and 2 deletions
|
|
@ -976,9 +976,9 @@ async def proxy_startup_event(app: FastAPI): # noqa: PLR0915
|
|||
|
||||
# Shutdown event - close guardrail/callback resources (e.g. presidio aiohttp sessions)
|
||||
for callback in litellm.callbacks:
|
||||
if hasattr(callback, "async_close") and callable(callback.async_close):
|
||||
if hasattr(callback, "async_close") and callable(callback.async_close): # type: ignore[union-attr]
|
||||
try:
|
||||
await callback.async_close()
|
||||
await callback.async_close() # type: ignore[union-attr]
|
||||
except Exception as e:
|
||||
verbose_proxy_logger.error(
|
||||
f"Error closing callback {type(callback).__name__}: {e}"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue