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

Commit 2d443a98 authored by Jackeagle's avatar Jackeagle
Browse files

Optimize repo sync for faster subsequent builds

- Increase parallel job limit from 10 to 16 (repo sync is network-bound)
- Remove --force-sync from main sync to enable incremental syncs
- Remove --force-sync from date-change sync
- Keep --force-sync only for recovery after sync failure

Expected time savings: 5-10 minutes on subsequent builds.
parent 4b5dac61
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -21,8 +21,9 @@
cd "$SRC_DIR" || return 1

# Determine the number of parallel jobs to use for repo sync
# Repo sync is network-bound, so we can use more parallel jobs
nproc_value=$(nproc --all)
JOBS=$((nproc_value > 10 ? 10 : nproc_value))
JOBS=$((nproc_value > 16 ? 16 : nproc_value))

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

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

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

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