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

Commit ea5ed4eb authored by Jackeagle's avatar Jackeagle
Browse files

Merge branch 'master-beta' into 'master'

src/build.sh: Limit parallel jobs in repo sync to a maximum of 10

See merge request !92
parents a229f7c4 15f37d20
Loading
Loading
Loading
Loading
+6 −2
Original line number Original line Diff line number Diff line
@@ -20,6 +20,10 @@
# cd to working directory
# cd to working directory
cd "$SRC_DIR" || return 1
cd "$SRC_DIR" || return 1


# Determine the number of parallel jobs to use for repo sync
nproc_value=$(nproc --all)
JOBS=$(( nproc_value > 10 ? 10 : nproc_value ))

if [ -f /root/userscripts/begin.sh ]; then
if [ -f /root/userscripts/begin.sh ]; then
  echo ">> [$(date)] Running begin.sh"
  echo ">> [$(date)] Running begin.sh"
  /root/userscripts/begin.sh
  /root/userscripts/begin.sh
@@ -186,7 +190,7 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then


  echo ">> [$(date)] Syncing branch repository"
  echo ">> [$(date)] Syncing branch repository"
  builddate=$(date +%Y%m%d)
  builddate=$(date +%Y%m%d)
  repo_out=$(repo sync -c -j$(nproc --all) --force-sync 2>&1 >/dev/null)
  repo_out=$(repo sync -c -j"$JOBS" --force-sync 2>&1 >/dev/null)
  repo_status=$?
  repo_status=$?
  echo -e $repo_out
  echo -e $repo_out


@@ -267,7 +271,7 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then
      echo ">> [$(date)] Syncing branch repository"
      echo ">> [$(date)] Syncing branch repository"
      cd "$SRC_DIR/$branch_dir" || return 1
      cd "$SRC_DIR/$branch_dir" || return 1


      if ! repo sync -c -j$(nproc --all) --force-sync; then
      if ! repo sync -c -j"$JOBS" --force-sync; then
        sync_successful=false
        sync_successful=false
        build_device=false
        build_device=false
      fi
      fi