forked from clan/clan-core
Merge pull request 'clan: add completion timeout as static' (#1523) from a-kenji-clan/completions into main
This commit is contained in:
commit
f2a884ec30
@ -20,6 +20,10 @@ except ImportError:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
# The default completion timeout for commands
|
||||||
|
COMPLETION_TIMEOUT: int = 3
|
||||||
|
|
||||||
|
|
||||||
def clan_dir(flake: str | None) -> str | None:
|
def clan_dir(flake: str | None) -> str | None:
|
||||||
from .dirs import get_clan_flake_toplevel_or_env
|
from .dirs import get_clan_flake_toplevel_or_env
|
||||||
|
|
||||||
@ -59,7 +63,7 @@ def complete_machines(
|
|||||||
|
|
||||||
thread = threading.Thread(target=run_cmd)
|
thread = threading.Thread(target=run_cmd)
|
||||||
thread.start()
|
thread.start()
|
||||||
thread.join(timeout=3)
|
thread.join(timeout=COMPLETION_TIMEOUT)
|
||||||
|
|
||||||
if thread.is_alive():
|
if thread.is_alive():
|
||||||
return iter([])
|
return iter([])
|
||||||
|
Loading…
Reference in New Issue
Block a user