~ubuntu-branches/ubuntu/trusty/baloo/trusty-proposed

« back to all changes in this revision

Viewing changes to debian/patches/upstream_git/0021-Cleaner-Commit-the-changes-every-1000-documents.patch

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2014-04-10 21:32:59 UTC
  • mfrom: (1.1.3)
  • Revision ID: package-import@ubuntu.com-20140410213259-b3hkzveqwe4hd3ax
Tags: 4:4.13.0-0ubuntu1
New upstream KDE Software Compilation release

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
From 6493efc09e69bfd974b86937017eaa9210cf7420 Mon Sep 17 00:00:00 2001
2
 
From: Vishesh Handa <me@vhanda.in>
3
 
Date: Sat, 29 Mar 2014 17:45:27 +0100
4
 
Subject: [PATCH 21/56] Cleaner: Commit the changes every 1000 documents
5
 
 
6
 
---
7
 
 src/file/cleaner/cleaner.cpp | 7 +++++++
8
 
 1 file changed, 7 insertions(+)
9
 
 
10
 
diff --git a/src/file/cleaner/cleaner.cpp b/src/file/cleaner/cleaner.cpp
11
 
index 1cfec6f..d64a39d 100644
12
 
--- a/src/file/cleaner/cleaner.cpp
13
 
+++ b/src/file/cleaner/cleaner.cpp
14
 
@@ -50,6 +50,7 @@ void Cleaner::start()
15
 
 
16
 
     FileIndexerConfig config;
17
 
 
18
 
+    int numDocuments = 0;
19
 
     while (query.next()) {
20
 
         int id = query.value(0).toInt();
21
 
         QString url = query.value(1).toString();
22
 
@@ -75,6 +76,12 @@ void Cleaner::start()
23
 
             q.addBindValue(id);
24
 
             q.exec();
25
 
             m_commitQueue->remove(id);
26
 
+
27
 
+            numDocuments++;
28
 
+        }
29
 
+
30
 
+        if (numDocuments >= 1000) {
31
 
+            m_commitQueue->commit();
32
 
         }
33
 
     }
34
 
 
35
 
1.9.1
36