use a transaction for getFiles
This commit is contained in:
parent
00635b3ce9
commit
f50fcdb8f0
5
atom
5
atom
@ -418,6 +418,8 @@ InsertOrUpdate() {
|
|||||||
|
|
||||||
getFiles() {
|
getFiles() {
|
||||||
scantime=$(date +%s)
|
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
|
while read time size filename
|
||||||
do
|
do
|
||||||
sourcefileid=$(
|
sourcefileid=$(
|
||||||
@ -429,10 +431,11 @@ getFiles() {
|
|||||||
filename $filename
|
filename $filename
|
||||||
EOWhere
|
EOWhere
|
||||||
)
|
)
|
||||||
echo $sourcefileid "$filename"
|
echo -ne '\r'$sourcefileid
|
||||||
done < <(
|
done < <(
|
||||||
find "$sourcepath" -type f -printf "%T@ %s %P\n"
|
find "$sourcepath" -type f -printf "%T@ %s %P\n"
|
||||||
)
|
)
|
||||||
|
echo 'COMMIT;' >&3
|
||||||
}
|
}
|
||||||
|
|
||||||
getType() {
|
getType() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user