From c83354d1a57e742a034fd3e428a6994e9fff98d9 Mon Sep 17 00:00:00 2001 From: Heavybullets8 Date: Thu, 4 Aug 2022 18:54:15 -0600 Subject: [PATCH] update async --- functions/update_apps.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/functions/update_apps.sh b/functions/update_apps.sh index ab30afd2..5df910ab 100644 --- a/functions/update_apps.sh +++ b/functions/update_apps.sh @@ -25,10 +25,11 @@ do if [[ "$proc_count" -ge "$update_limit" ]]; then sleep 3 elif [[ $it -lt ${#array[@]} ]]; then - until [[ ${#processes[@]} -ge "$update_limit" || ${#processes[@]} -ge ${#array[@]} ]] + until [[ "$proc_count" -ge "$update_limit" || $it -ge ${#array[@]} ]] do update_apps "${array[$it]}" & processes+=($!) + ((proc_count++)) ((it++)) done elif [[ $proc_count != 0 ]]; then # Wait for all processes to finish