Compare commits

...

3 Commits

Author SHA1 Message Date
Vincent Riquer
33120e8be3 atom: commit every 60 seconds when transcoding 2025-01-23 00:23:14 +01:00
Vincent Riquer
8b4c7e51ce atom: show progress when cleaning obsolete data 2025-01-23 00:20:32 +01:00
Vincent Riquer
792390678d getFiles: clear end of line when displaying summary 2025-01-23 00:19:16 +01:00
2 changed files with 11 additions and 2 deletions

11
atom
View File

@ -353,6 +353,7 @@ updateMimes
removeObsoleteFiles
(( cron )) || echo -n 'Gathering files for cleaning...'
echo '
SELECT COUNT(id)
FROM destination_files
@ -400,7 +401,7 @@ do
then
echo 'COMMIT;BEGIN TRANSACTION;' >&3
fi
(( cron )) || echo -en "\rClean obsolete data: $(((deleted+removed)*100/removecount))%"
(( cron )) || echo -en "\rClean obsolete data: $(((deleted+removed)*100/removecount))%\033[K"
done
echo 'COMMIT;' >&3
(( cron )) || echo -n $'\r'
@ -696,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 ))
@ -798,6 +806,7 @@ do
fi
fi
done
echo 'COMMIT;' >&3
unset count
endtime=$(date +%s)

View File

@ -60,6 +60,6 @@ getFiles() {
)
echo 'COMMIT;' >&3
(( cron )) || echo -n $'\r'
echo "${count:-0} files found, ${new:=0} new or changed."
echo "${count:-0} files found, ${new:=0} new or changed."$'\033[K'
unset count
}