This commit is contained in:
Heavybullets8 2022-07-25 16:46:05 -06:00
parent b499b87dc1
commit 749b591c46

View File

@ -9,13 +9,14 @@ mapfile -t array < <(cli -m csv -c 'app chart_release query name,update_availabl
update_limit=4 update_limit=4
it=0 it=0
while [[ $it -lt ${#array[@]} ]] while [[ $it -lt ${#array[@]} ]]
do do
jobs=$(jobs -p | wc -l) jobs=$(jobs -p | wc -l)
if [[ "$jobs" -ge "$update_limit" ]]; then if [[ "$jobs" -ge "$update_limit" ]]; then
sleep 3 sleep 3
else else
coproc update_appsfd { update_apps "${array[$it]}" ; } update_apps "${array[$it]}"
processes+=($!) processes+=($!)
((it++)) ((it++))
fi fi
@ -26,10 +27,6 @@ do
wait "$proc" wait "$proc"
done done
IFS= read -r -d '' -u "${update_appsfd[0]}" update_output
echo "$update_output"
} }
export -f commander export -f commander
@ -85,7 +82,7 @@ printf '%s\0' "${ignore[@]}" | grep -iFxqz "${app_name}" && echo -e "\n$app_name
echo -e "\n$app_name\nMajor Release, update manually" echo -e "\n$app_name\nMajor Release, update manually"
return return
fi fi
} } | sort
export -f update_apps export -f update_apps