atom: add -f <workers>
This commit is contained in:
parent
1c7dff9f83
commit
cc9ccc6dc5
11
atom
11
atom
@ -64,6 +64,7 @@ help() {
|
|||||||
-c <file> Load configuration file <file>
|
-c <file> Load configuration file <file>
|
||||||
-C Dump configuration and exit
|
-C Dump configuration and exit
|
||||||
-l <load> Override max-load
|
-l <load> Override max-load
|
||||||
|
-f <workers> Use exactly <workers> child processes
|
||||||
-T <seconds> override load-interval
|
-T <seconds> override load-interval
|
||||||
-F <destination> Force re-generation of all files in
|
-F <destination> Force re-generation of all files in
|
||||||
<destination>
|
<destination>
|
||||||
@ -77,7 +78,7 @@ help() {
|
|||||||
|
|
||||||
#parse arguments
|
#parse arguments
|
||||||
OPTERR=0
|
OPTERR=0
|
||||||
while getopts ':c:Cl:T:F:B:ShDq' opt
|
while getopts ':c:Cl:T:F:f:B:ShDq' opt
|
||||||
do
|
do
|
||||||
case $opt in
|
case $opt in
|
||||||
c)
|
c)
|
||||||
@ -95,6 +96,9 @@ do
|
|||||||
F)
|
F)
|
||||||
forceall+=("$OPTARG")
|
forceall+=("$OPTARG")
|
||||||
;;
|
;;
|
||||||
|
f)
|
||||||
|
fixed_workers="$OPTARG"
|
||||||
|
;;
|
||||||
B)
|
B)
|
||||||
maxbatch="$OPTARG"
|
maxbatch="$OPTARG"
|
||||||
;;
|
;;
|
||||||
@ -696,6 +700,10 @@ while (( (remaining || ${#workers[@]}) && ! quit ))
|
|||||||
do
|
do
|
||||||
read humanload garbage < /proc/loadavg
|
read humanload garbage < /proc/loadavg
|
||||||
load=${humanload%.*}
|
load=${humanload%.*}
|
||||||
|
if (( fixed_workers ))
|
||||||
|
then
|
||||||
|
concurrency="$fixed_workers"
|
||||||
|
else
|
||||||
if [ -z "$quit" ] \
|
if [ -z "$quit" ] \
|
||||||
&& (( ! pause )) \
|
&& (( ! pause )) \
|
||||||
&& (( $(date +%s)-concurrencychange >= loadinterval ))
|
&& (( $(date +%s)-concurrencychange >= loadinterval ))
|
||||||
@ -709,6 +717,7 @@ do
|
|||||||
then
|
then
|
||||||
concurrencychange=$(date +%s)
|
concurrencychange=$(date +%s)
|
||||||
(( ++concurrency ))
|
(( ++concurrency ))
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
checkworkers
|
checkworkers
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user