Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase timeout for clone command #852

Merged
merged 3 commits into from
Jun 20, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions alibuild_helpers/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@
import os

GIT_COMMAND_TIMEOUT_SEC = 120
"""How many seconds to let any git command execute before being terminated."""
"""Default value for how many seconds to let any git command execute before being terminated."""

GIT_CMD_TIMEOUTS = {
"clone": 600,
ktf marked this conversation as resolved.
Show resolved Hide resolved
}
"""Customised timeout for some commands."""

def clone_speedup_options():
"""Return a list of options supported by the system git which speed up cloning."""
Expand Down Expand Up @@ -93,7 +97,7 @@ def git(args, directory=".", check=True, prompt=True):
# GIT_TERMINAL_PROMPT is only supported in git 2.3+.
prompt_var=f"GIT_TERMINAL_PROMPT=0" if not prompt else "",
directory_safe_var=f"GIT_CONFIG_COUNT={lastGitOverride+2} GIT_CONFIG_KEY_{lastGitOverride}=safe.directory GIT_CONFIG_VALUE_{lastGitOverride}=$PWD GIT_CONFIG_KEY_{lastGitOverride+1}=gc.auto GIT_CONFIG_VALUE_{lastGitOverride+1}=0" if directory else "",
), timeout=GIT_COMMAND_TIMEOUT_SEC)
), timeout=GIT_CMD_TIMEOUTS.get(args[0] if len(args) else "*", GIT_COMMAND_TIMEOUT_SEC))
if check and err != 0:
raise SCMError("Error {} from git {}: {}".format(err, " ".join(args), output))
return output if check else (err, output)
Loading