From 06bb4e569f6cc9b2e0fa8c6493deff9d03290501 Mon Sep 17 00:00:00 2001 From: Heavybullets8 Date: Wed, 10 Aug 2022 22:14:30 -0600 Subject: [PATCH] racing --- functions/update_apps.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/functions/update_apps.sh b/functions/update_apps.sh index fc0bdae3..45a24abc 100644 --- a/functions/update_apps.sh +++ b/functions/update_apps.sh @@ -57,7 +57,6 @@ echo "Asynchronous Updates: $update_limit" # echo # echo -final_check=0 it=0 while true do @@ -78,18 +77,17 @@ do if [[ "$proc_count" -ge "$update_limit" ]]; then sleep 3 elif [[ $it -lt ${#array[@]} ]]; then - # loop=0 - # until [[ "$loop" -ge 2 || $it -ge ${#array[@]} ]]; - # do + loop=0 + until [[ "$loop" -ge 2 || $it -ge ${#array[@]} ]]; + do update_apps "${array[$it]}" & processes+=($!) ((loop++)) ((it++)) - # done + done elif [[ $proc_count != 0 ]]; then # Wait for all processes to finish sleep 3 else # All processes must be completed, break out of loop - [[ $final_check == 0 ]] && ((final_check++)) && continue break fi done