update async

This commit is contained in:
Heavybullets8 2022-08-04 18:54:15 -06:00
parent 3eae25dede
commit c83354d1a5

View File

@ -25,10 +25,11 @@ do
if [[ "$proc_count" -ge "$update_limit" ]]; then if [[ "$proc_count" -ge "$update_limit" ]]; then
sleep 3 sleep 3
elif [[ $it -lt ${#array[@]} ]]; then elif [[ $it -lt ${#array[@]} ]]; then
until [[ ${#processes[@]} -ge "$update_limit" || ${#processes[@]} -ge ${#array[@]} ]] until [[ "$proc_count" -ge "$update_limit" || $it -ge ${#array[@]} ]]
do do
update_apps "${array[$it]}" & update_apps "${array[$it]}" &
processes+=($!) processes+=($!)
((proc_count++))
((it++)) ((it++))
done done
elif [[ $proc_count != 0 ]]; then # Wait for all processes to finish elif [[ $proc_count != 0 ]]; then # Wait for all processes to finish