This commit is contained in:
Heavybullets8 2022-07-25 15:15:25 -06:00
parent f0e7624c51
commit 69875f8fda

View File

@ -7,7 +7,6 @@ mapfile -t array < <(cli -m csv -c 'app chart_release query name,update_availabl
[[ -z $timeout ]] && echo -e "\nDefault Timeout: 500" && timeout=500 || echo -e "\nCustom Timeout: $timeout" [[ -z $timeout ]] && echo -e "\nDefault Timeout: 500" && timeout=500 || echo -e "\nCustom Timeout: $timeout"
[[ "$timeout" -le 120 ]] && echo "Warning: Your timeout is set low and may lead to premature rollbacks or skips" [[ "$timeout" -le 120 ]] && echo "Warning: Your timeout is set low and may lead to premature rollbacks or skips"
update_limit=2 update_limit=2
current_updates=0
it=0 it=0
while [[ $it -lt ${#array[@]} ]] while [[ $it -lt ${#array[@]} ]]
@ -16,15 +15,14 @@ do
if [[ "$jobs" -ge "$update_limit" ]]; then if [[ "$jobs" -ge "$update_limit" ]]; then
sleep 3 sleep 3
else else
update_apps "${array[$it]}" & application="${array[$it]}"
update_apps "$application" &
processes+=($!) processes+=($!)
((it++)) ((it++))
fi fi
done done
for proc in "${processes[@]}" for proc in "${processes[@]}"
do do
wait "$proc" wait "$proc"