atom: commit every 60 seconds when transcoding

This commit is contained in:
Vincent Riquer 2025-01-23 00:23:14 +01:00
parent 8b4c7e51ce
commit 33120e8be3

8
atom
View File

@ -697,8 +697,15 @@ starttime=$concurrencychange
taskcount=$count
remaining=$taskcount
failed=0
echo 'BEGIN TRANSACTION;' >&3
committime=$(date +%s)
while (( (remaining || ${#workers[@]}) && ! quit ))
do
if (( $(date +%s) - committime >= 60 ))
then
echo $'COMMIT;\nBEGIN TRANSACTION;' >&3
committime=$(date +%s)
fi
read humanload garbage < /proc/loadavg
load=${humanload%.*}
if (( fixed_workers ))
@ -799,6 +806,7 @@ do
fi
fi
done
echo 'COMMIT;' >&3
unset count
endtime=$(date +%s)