summaryrefslogtreecommitdiffstats
path: root/tests/storagebenchmark.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2015-08-13 22:43:36 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2015-08-13 22:43:36 +0200
commit4385c6bae1a66aa94beb703dcc16e12bdf0ebb0e (patch)
treef0ff0b4a847cf9d28138749a24b3087eafe7559f /tests/storagebenchmark.cpp
parent4fb293ac5c684c9bb7bf0e8d1e9d5b0f3f4296ab (diff)
downloadsink-4385c6bae1a66aa94beb703dcc16e12bdf0ebb0e.tar.gz
sink-4385c6bae1a66aa94beb703dcc16e12bdf0ebb0e.zip
Autocommit for the transaction
Diffstat (limited to 'tests/storagebenchmark.cpp')
-rw-r--r--tests/storagebenchmark.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/tests/storagebenchmark.cpp b/tests/storagebenchmark.cpp
index fba72ad..ce1005d 100644
--- a/tests/storagebenchmark.cpp
+++ b/tests/storagebenchmark.cpp
@@ -97,14 +97,8 @@ private Q_SLOTS:
97 auto event = createEvent(); 97 auto event = createEvent();
98 if (store) { 98 if (store) {
99 auto transaction = store->createTransaction(Akonadi2::Storage::ReadWrite); 99 auto transaction = store->createTransaction(Akonadi2::Storage::ReadWrite);
100 transaction.setAutocommit(10000);
100 for (int i = 0; i < count; i++) { 101 for (int i = 0; i < count; i++) {
101 if (i % 10000 == 0) {
102 if (i > 0) {
103 transaction.commit();
104 transaction = std::move(store->createTransaction(Akonadi2::Storage::ReadWrite));
105 }
106 }
107
108 transaction.write(keyPrefix + QByteArray::number(i), event); 102 transaction.write(keyPrefix + QByteArray::number(i), event);
109 } 103 }
110 transaction.commit(); 104 transaction.commit();