Update litellm/proxy/proxy_server.py

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
This commit is contained in:
Ishaan Jaff 2026-03-06 18:09:08 -08:00 • committed by GitHub
parent 82dbf1918d
commit b4f2918730
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -775,9 +775,10 @@ async def proxy_startup_event(app: FastAPI): # noqa: PLR0915
_module_path, _func_name = _hook_spec.rsplit(":", 1)
_module = importlib.import_module(_module_path)
_hook_fn = getattr(_module, _func_name)
_result = _hook_fn()
if asyncio.iscoroutine(_result):
await _result
if inspect.iscoroutinefunction(_hook_fn):
await _hook_fn()
else:
_hook_fn()
verbose_proxy_logger.info(
"Worker startup hook '%s' executed successfully", _hook_spec
)