From f50fcdb8f0f96218e53787678a8ba69e6a8c5352 Mon Sep 17 00:00:00 2001 From: Vincent Riquer Date: Tue, 26 Feb 2013 02:11:40 +0100 Subject: [PATCH] use a transaction for getFiles --- atom | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/atom b/atom index 55ff687..a370c32 100755 --- a/atom +++ b/atom @@ -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() {