|
|
@@ -11,6 +11,8 @@ done |
|
|
|
|
|
|
|
# Optional env variables |
|
|
|
declare -i timeout="${CODEARCHIVER_BOT_TIMEOUT:-0}" |
|
|
|
declare -i nproclimit="${CODEARCHIVER_BOT_NPROC:-1}" |
|
|
|
declare -i nproc=0 |
|
|
|
|
|
|
|
for dep in awk codearchiver curl ia-upload-stream python3 sha256sum tee zstd; do |
|
|
|
if ! command -v "${dep}" &>/dev/null; then |
|
|
@@ -136,6 +138,13 @@ function taint_block { |
|
|
|
continue |
|
|
|
fi |
|
|
|
|
|
|
|
# Block until there's a free slot |
|
|
|
while [[ "${nproc}" -ge "${nproclimit}" ]]; do |
|
|
|
# Wait for one subshell to exit |
|
|
|
wait -n |
|
|
|
nproc+=-1 |
|
|
|
done |
|
|
|
|
|
|
|
taint_block 'continuing with work loop' |
|
|
|
|
|
|
|
# Find nonexistent filename for log file with lock |
|
|
@@ -216,7 +225,7 @@ function taint_block { |
|
|
|
fi |
|
|
|
fi |
|
|
|
) & |
|
|
|
wait |
|
|
|
nproc+=1 |
|
|
|
done | |
|
|
|
|
|
|
|
# Upload |
|
|
|