use a transaction for getFiles

This commit is contained in:
Vincent Riquer 2013-02-26 02:11:40 +01:00
parent 00635b3ce9
commit f50fcdb8f0

5
atom
View File

@ -418,6 +418,8 @@ InsertOrUpdate() {
getFiles() {
scantime=$(date +%s)
# We probably have thousands of files, don't waste time on disk writes
echo 'BEGIN TRANSACTION;' >&3
while read time size filename
do
sourcefileid=$(
@ -429,10 +431,11 @@ getFiles() {
filename $filename
EOWhere
)
echo $sourcefileid "$filename"
echo -ne '\r'$sourcefileid
done < <(
find "$sourcepath" -type f -printf "%T@ %s %P\n"
)
echo 'COMMIT;' >&3
}
getType() {