From 17914fada84ab01c12505ef87e930cc5fe63c0fe Mon Sep 17 00:00:00 2001 From: Heavybullets8 Date: Thu, 4 Aug 2022 19:10:02 -0600 Subject: [PATCH] if gt than 1 sleep --- functions/update_apps.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/functions/update_apps.sh b/functions/update_apps.sh index 793dc826..2cfb6526 100644 --- a/functions/update_apps.sh +++ b/functions/update_apps.sh @@ -25,14 +25,16 @@ do if [[ "$proc_count" -ge "$update_limit" ]]; then sleep 3 elif [[ $it -lt ${#array[@]} ]]; then + new_updates=0 until [[ "$proc_count" -ge "$update_limit" || $it -ge ${#array[@]} ]] do update_apps "${array[$it]}" & processes+=($!) ((proc_count++)) ((it++)) + ((new_updates++)) done - sleep 3 + [[ $new_updates -gt 1 ]] && sleep 3 elif [[ $proc_count != 0 ]]; then # Wait for all processes to finish sleep 3 else # All processes must be completed, break out of loop