From cc9ccc6dc530d15c12d7c2af05f93d4dac7537fe Mon Sep 17 00:00:00 2001 From: Vincent Riquer Date: Thu, 23 Jan 2025 00:10:21 +0100 Subject: [PATCH] atom: add -f --- atom | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/atom b/atom index 671ca4e..dd80073 100755 --- a/atom +++ b/atom @@ -64,6 +64,7 @@ help() { -c Load configuration file -C Dump configuration and exit -l Override max-load + -f Use exactly child processes -T override load-interval -F Force re-generation of all files in @@ -77,7 +78,7 @@ help() { #parse arguments OPTERR=0 -while getopts ':c:Cl:T:F:B:ShDq' opt +while getopts ':c:Cl:T:F:f:B:ShDq' opt do case $opt in c) @@ -95,6 +96,9 @@ do F) forceall+=("$OPTARG") ;; + f) + fixed_workers="$OPTARG" + ;; B) maxbatch="$OPTARG" ;; @@ -696,6 +700,10 @@ while (( (remaining || ${#workers[@]}) && ! quit )) do read humanload garbage < /proc/loadavg load=${humanload%.*} + if (( fixed_workers )) + then + concurrency="$fixed_workers" + else if [ -z "$quit" ] \ && (( ! pause )) \ && (( $(date +%s)-concurrencychange >= loadinterval )) @@ -709,6 +717,7 @@ do then concurrencychange=$(date +%s) (( ++concurrency )) + fi fi fi checkworkers