Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e4724f16 authored by Jackeagle's avatar Jackeagle Committed by Jackeagle
Browse files

build-community: Limit parallel jobs in repo sync to a maximum of 10

parent a2d338dd
Loading
Loading
Loading
Loading
+7 −3
Original line number Original line Diff line number Diff line
@@ -20,6 +20,10 @@


repo_log="$LOGS_DIR/repo-$(date +%Y%m%d).log"
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 to working directory
cd "$SRC_DIR"
cd "$SRC_DIR"


@@ -66,7 +70,7 @@ if [ "$LOCAL_MIRROR" = true ]; then
  fi
  fi


  echo ">> [$(date)] Syncing mirror repository" | tee -a "$repo_log"
  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
  if [ $? != 0 ]; then
    sync_successful=false
    sync_successful=false
@@ -160,7 +164,7 @@ for branch in ${BRANCH_NAME//,/ }; do


    echo ">> [$(date)] Syncing branch repository" | tee -a "$repo_log"
    echo ">> [$(date)] Syncing branch repository" | tee -a "$repo_log"
    builddate=$(date +%Y%m%d)
    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
    if [ $? != 0 ]; then
      sync_successful=false
      sync_successful=false
@@ -245,7 +249,7 @@ for branch in ${BRANCH_NAME//,/ }; do
          if [ "$LOCAL_MIRROR" = true ]; then
          if [ "$LOCAL_MIRROR" = true ]; then
            echo ">> [$(date)] Syncing mirror repository" | tee -a "$repo_log"
            echo ">> [$(date)] Syncing mirror repository" | tee -a "$repo_log"
            cd "$MIRROR_DIR"
            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
            if [ $? != 0 ]; then
              sync_successful=false
              sync_successful=false