From d31aa7cf88284b31fe8524d0fde5dc7df7eb99f2 Mon Sep 17 00:00:00 2001 From: a-kenji Date: Fri, 31 May 2024 13:06:46 +0200 Subject: [PATCH] clan: add completion timeout as static --- pkgs/clan-cli/clan_cli/completions.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/clan-cli/clan_cli/completions.py b/pkgs/clan-cli/clan_cli/completions.py index 466c2926e..21e9fc1cb 100644 --- a/pkgs/clan-cli/clan_cli/completions.py +++ b/pkgs/clan-cli/clan_cli/completions.py @@ -20,6 +20,10 @@ except ImportError: pass +# The default completion timeout for commands +COMPLETION_TIMEOUT: int = 3 + + def clan_dir(flake: str | None) -> str | None: from .dirs import get_clan_flake_toplevel_or_env @@ -59,7 +63,7 @@ def complete_machines( thread = threading.Thread(target=run_cmd) thread.start() - thread.join(timeout=3) + thread.join(timeout=COMPLETION_TIMEOUT) if thread.is_alive(): return iter([])