diff --git a/ragna/deploy/_cli/core.py b/ragna/deploy/_cli/core.py index 985b70e5..4d4469df 100644 --- a/ragna/deploy/_cli/core.py +++ b/ragna/deploy/_cli/core.py @@ -131,12 +131,19 @@ def check_api_available() -> bool: try: if process is not None: - @timeout_after() + @timeout_after(60) def wait_for_api() -> None: while not check_api_available(): time.sleep(0.5) - wait_for_api() + try: + wait_for_api() + except TimeoutError: + rich.print( + "Failed to start the API in 60 seconds. " + "Please start it manually with [bold]ragna api[/bold]." + ) + raise typer.Exit(1) ui_app(config).serve() # type: ignore[no-untyped-call] finally: