Apply suggestion from @greptile-apps[bot]

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:34 -08:00 • committed by GitHub
parent b4f2918730
commit afb45595f3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -772,6 +772,10 @@ async def proxy_startup_event(app: FastAPI): # noqa: PLR0915
if not _hook_spec:
continue
try:
if ":" not in _hook_spec:
raise ValueError(
f"Invalid hook spec '{_hook_spec}': expected format is 'module.path:function_name'"
)
_module_path, _func_name = _hook_spec.rsplit(":", 1)
_module = importlib.import_module(_module_path)
_hook_fn = getattr(_module, _func_name)