Skip to content

Commit

Permalink
Fix checking running jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
kmagusiak committed Dec 29, 2023
1 parent 8aca52e commit c27cdd7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bashf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,7 @@ finish_jobs() {
sleep 0.1
check_jobs || true
done
quiet jobs
log_debug " $JOBS_SUCCESS jobs finished"
[ "$JOBS_FAIL" -eq 0 ] || log_debug " $JOBS_FAIL jobs failed"
log_debug "Finishing all jobs"
Expand All @@ -1068,11 +1069,12 @@ spawn() {
)
[ "$1" != '--' ] || shift
# throttle
while [ $(jobs | wc -l) -ge "$JOBS_PARALLELISM" ]
while [ ${#JOBS_PIDS[@]} -ge "$JOBS_PARALLELISM" ]
do
sleep 0.1
check_jobs || (( ret += $? ))
done
quiet jobs
[ ${#JOBS_PIDS[@]} -le "$JOBS_PARALLELISM" ] || \
check_jobs || (( ret += $? ))
# start
Expand Down

0 comments on commit c27cdd7

Please sign in to comment.