From b4f29187308c4cc1f70513b7a4861150a60f6d30 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Fri, 6 Mar 2026 18:09:08 -0800 Subject: [PATCH] Update litellm/proxy/proxy_server.py Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --- litellm/proxy/proxy_server.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.py index 6104d9c7ec9..5b98ba50e69 100644 --- a/litellm/proxy/proxy_server.py +++ b/litellm/proxy/proxy_server.py @@ -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 )