Skip to content

Commit ebbcbb1

Browse files
rodrigo-sobraletejedor
authored andcommitted
swancustomenvironments: Add a 45s timeout on cloning
As ATS clusters do not access to the internet, causing repository clones from Github to fail. The git command timeout takes about 2 minutes to take action, but after around one minute, the frontend invokation to the backend gets timed out too, but without printing any message informing the user about the reason for it to fail. For this reason, a slightly smaller timeout (of 45s) needs to be explicitly done in the script to lead to an error that outputs a useful feedback in the frontend.
1 parent 88e9a18 commit ebbcbb1

File tree

1 file changed

+1
-1
lines changed
  • SwanCustomEnvironments/swancustomenvironments/scripts

1 file changed

+1
-1
lines changed

SwanCustomEnvironments/swancustomenvironments/scripts/makenv.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ if [[ "$REPOSITORY" =~ $REPO_GIT_PATTERN ]]; then
140140
# Otherwise, use the existing one in the SWAN_projects folder
141141
if [ ! -d "${GIT_REPO_PATH}" ]; then
142142
_log "Cloning the repository from ${REPOSITORY}..."
143-
git clone $REPOSITORY -q "${TMP_REPO_PATH}" 2>&1
143+
timeout 45s git clone $REPOSITORY -q "${TMP_REPO_PATH}" 2>&1
144144
if [ $? -ne 0 ]; then
145145
_log "ERROR: Failed to clone Git repository" && exit 1
146146
fi

0 commit comments

Comments
 (0)