From 33120e8be3e54a50af7e81124a5982ebaec8fac6 Mon Sep 17 00:00:00 2001 From: Vincent Riquer Date: Thu, 23 Jan 2025 00:23:14 +0100 Subject: [PATCH] atom: commit every 60 seconds when transcoding --- atom | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/atom b/atom index 6439553..993c32c 100755 --- a/atom +++ b/atom @@ -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)