From e4724f16782e6c123ba2df6726cfc3d46c67470a Mon Sep 17 00:00:00 2001 From: Jackeagle <116548-Jackeagle@users.noreply.gitlab.e.foundation> Date: Thu, 13 Jun 2024 15:02:17 +0000 Subject: [PATCH] build-community: Limit parallel jobs in repo sync to a maximum of 10 --- build-community.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/build-community.sh b/build-community.sh index 7743653..b2b73b5 100755 --- a/build-community.sh +++ b/build-community.sh @@ -20,6 +20,10 @@ repo_log="$LOGS_DIR/repo-$(date +%Y%m%d).log" +# Determine the number of parallel jobs to use for repo sync +nproc_value=$(nproc --all) +JOBS=$(( nproc_value > 10 ? 10 : nproc_value )) + # cd to working directory cd "$SRC_DIR" @@ -66,7 +70,7 @@ if [ "$LOCAL_MIRROR" = true ]; then fi echo ">> [$(date)] Syncing mirror repository" | tee -a "$repo_log" - repo sync -j$(nproc --all) --force-sync --no-clone-bundle &>>"$repo_log" + repo sync -j"$JOBS" --force-sync --no-clone-bundle &>>"$repo_log" if [ $? != 0 ]; then sync_successful=false @@ -160,7 +164,7 @@ for branch in ${BRANCH_NAME//,/ }; do echo ">> [$(date)] Syncing branch repository" | tee -a "$repo_log" builddate=$(date +%Y%m%d) - repo sync -c -j$(nproc --all) --force-sync &>>"$repo_log" + repo sync -c -j"$JOBS" --force-sync &>>"$repo_log" if [ $? != 0 ]; then sync_successful=false @@ -245,7 +249,7 @@ for branch in ${BRANCH_NAME//,/ }; do if [ "$LOCAL_MIRROR" = true ]; then echo ">> [$(date)] Syncing mirror repository" | tee -a "$repo_log" cd "$MIRROR_DIR" - repo sync -j$(nproc --all) --force-sync --no-clone-bundle &>>"$repo_log" + repo sync -j"$JOBS" --force-sync --no-clone-bundle &>>"$repo_log" if [ $? != 0 ]; then sync_successful=false -- GitLab