racing
This commit is contained in:
parent
b012416a07
commit
06bb4e569f
@ -57,7 +57,6 @@ echo "Asynchronous Updates: $update_limit"
|
|||||||
# echo
|
# echo
|
||||||
# echo
|
# echo
|
||||||
|
|
||||||
final_check=0
|
|
||||||
it=0
|
it=0
|
||||||
while true
|
while true
|
||||||
do
|
do
|
||||||
@ -78,18 +77,17 @@ 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
|
||||||
# loop=0
|
loop=0
|
||||||
# until [[ "$loop" -ge 2 || $it -ge ${#array[@]} ]];
|
until [[ "$loop" -ge 2 || $it -ge ${#array[@]} ]];
|
||||||
# do
|
do
|
||||||
update_apps "${array[$it]}" &
|
update_apps "${array[$it]}" &
|
||||||
processes+=($!)
|
processes+=($!)
|
||||||
((loop++))
|
((loop++))
|
||||||
((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
|
||||||
sleep 3
|
sleep 3
|
||||||
else # All processes must be completed, break out of loop
|
else # All processes must be completed, break out of loop
|
||||||
[[ $final_check == 0 ]] && ((final_check++)) && continue
|
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user