COMMIT every 1000 files

This commit is contained in:
Vincent Riquer 2013-03-08 13:00:28 +01:00
parent 807e0c961d
commit 0238b0a449

12
atom
View File

@ -571,6 +571,12 @@ getFiles() {
filename $filename filename $filename
EOWhere EOWhere
(( ++new )) (( ++new ))
if (( new % 1000 == 0 ))
then
echo 'COMMIT;BEGIN TRANSACTION;' >&3
(( debug )) \
&& echo -e "\rIdentified $new files, committing..."
fi
else else
Update source_files last_seen $scantime <<-EOWhere Update source_files last_seen $scantime <<-EOWhere
filename = $filename filename = $filename
@ -1034,6 +1040,12 @@ do
mimetype=${rest%%|*} mimetype=${rest%%|*}
filename=${rest#*|} filename=${rest#*|}
echo -en "\rTags: $((++count*100/filecount))%" echo -en "\rTags: $((++count*100/filecount))%"
if (( count % 1000 == 0 ))
then
echo 'COMMIT;BEGIN TRANSACTION;' >&3
(( debug )) \
&& echo " $count files read, committing..."
fi
if getTags if getTags
then then
Update tags \ Update tags \