summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-06-20 01:24:17 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-06-20 01:24:17 +0200
commit703b72511488068bdbc5e81172e674d0f07349ed (patch)
tree8fad8483c02bce7210401dd128cd1473c530d8d0 /examples
parentb10ca588b7a8a5e3bec22b9e683b4a4dbd5bc889 (diff)
downloadsink-703b72511488068bdbc5e81172e674d0f07349ed.tar.gz
sink-703b72511488068bdbc5e81172e674d0f07349ed.zip
Commit all databases in the same interval
Diffstat (limited to 'examples')
-rw-r--r--examples/imapresource/imapresource.cpp4
-rw-r--r--examples/maildirresource/maildirresource.cpp4
2 files changed, 0 insertions, 8 deletions
diff --git a/examples/imapresource/imapresource.cpp b/examples/imapresource/imapresource.cpp
index f9168e4..b5d224c 100644
--- a/examples/imapresource/imapresource.cpp
+++ b/examples/imapresource/imapresource.cpp
@@ -251,7 +251,6 @@ public:
251 251
252 createOrModify(bufferType, remoteId, mail); 252 createOrModify(bufferType, remoteId, mail);
253 } 253 }
254 commitSync();
255 const auto elapsed = time->elapsed(); 254 const auto elapsed = time->elapsed();
256 Log() << "Synchronized " << count << " mails in " << path << Sink::Log::TraceTime(elapsed) << " " << elapsed/qMax(count, 1) << " [ms/mail]"; 255 Log() << "Synchronized " << count << " mails in " << path << Sink::Log::TraceTime(elapsed) << " " << elapsed/qMax(count, 1) << " [ms/mail]";
257 } 256 }
@@ -310,7 +309,6 @@ public:
310 auto folderFuture = imap.fetchFolders([this, &imap, &folderList](const QVector<Folder> &folders) { 309 auto folderFuture = imap.fetchFolders([this, &imap, &folderList](const QVector<Folder> &folders) {
311 synchronizeFolders(folders); 310 synchronizeFolders(folders);
312 commit(); 311 commit();
313 commitSync();
314 folderList << folders; 312 folderList << folders;
315 313
316 }).exec(); 314 }).exec();
@@ -332,7 +330,6 @@ public:
332 } 330 }
333 synchronizeMails(folder.normalizedPath(), messages); 331 synchronizeMails(folder.normalizedPath(), messages);
334 commit(); 332 commit();
335 commitSync();
336 }).exec(); 333 }).exec();
337 messagesFuture.waitForFinished(); 334 messagesFuture.waitForFinished();
338 if (messagesFuture.errorCode()) { 335 if (messagesFuture.errorCode()) {
@@ -342,7 +339,6 @@ public:
342 //Remove what there is to remove 339 //Remove what there is to remove
343 synchronizeRemovals(folder.normalizedPath(), uids); 340 synchronizeRemovals(folder.normalizedPath(), uids);
344 commit(); 341 commit();
345 commitSync();
346 Trace() << "Folder synchronized: " << folder.normalizedPath(); 342 Trace() << "Folder synchronized: " << folder.normalizedPath();
347 } 343 }
348 344
diff --git a/examples/maildirresource/maildirresource.cpp b/examples/maildirresource/maildirresource.cpp
index 5fa7084..23e25c4 100644
--- a/examples/maildirresource/maildirresource.cpp
+++ b/examples/maildirresource/maildirresource.cpp
@@ -393,7 +393,6 @@ public:
393 393
394 createOrModify(bufferType, remoteId, mail); 394 createOrModify(bufferType, remoteId, mail);
395 } 395 }
396 commitSync();
397 const auto elapsed = time->elapsed(); 396 const auto elapsed = time->elapsed();
398 Log() << "Synchronized " << count << " mails in " << listingPath << Sink::Log::TraceTime(elapsed) << " " << elapsed/qMax(count, 1) << " [ms/mail]"; 397 Log() << "Synchronized " << count << " mails in " << listingPath << Sink::Log::TraceTime(elapsed) << " " << elapsed/qMax(count, 1) << " [ms/mail]";
399 } 398 }
@@ -409,12 +408,10 @@ public:
409 synchronizeFolders(); 408 synchronizeFolders();
410 //The next sync needs the folders available 409 //The next sync needs the folders available
411 commit(); 410 commit();
412 commitSync();
413 for (const auto &folder : listAvailableFolders()) { 411 for (const auto &folder : listAvailableFolders()) {
414 synchronizeMails(folder); 412 synchronizeMails(folder);
415 //Don't let the transaction grow too much 413 //Don't let the transaction grow too much
416 commit(); 414 commit();
417 commitSync();
418 } 415 }
419 Log() << "Done Synchronizing"; 416 Log() << "Done Synchronizing";
420 return KAsync::null<void>(); 417 return KAsync::null<void>();
@@ -515,7 +512,6 @@ MaildirResource::MaildirResource(const QByteArray &instanceIdentifier, const QSh
515 auto remoteId = synchronizer->createFolder(mDraftsFolder, "folder", QByteArrayList() << "drafts"); 512 auto remoteId = synchronizer->createFolder(mDraftsFolder, "folder", QByteArrayList() << "drafts");
516 auto draftsFolderLocalId = synchronizer->syncStore().resolveRemoteId(ENTITY_TYPE_FOLDER, remoteId); 513 auto draftsFolderLocalId = synchronizer->syncStore().resolveRemoteId(ENTITY_TYPE_FOLDER, remoteId);
517 synchronizer->commit(); 514 synchronizer->commit();
518 synchronizer->commitSync();
519 515
520 folderUpdater->mDraftsFolder = draftsFolderLocalId; 516 folderUpdater->mDraftsFolder = draftsFolderLocalId;
521 folderUpdater->mResourceInstanceIdentifier = mResourceInstanceIdentifier; 517 folderUpdater->mResourceInstanceIdentifier = mResourceInstanceIdentifier;