diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-01-17 20:17:46 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-01-17 20:17:46 +0100 |
commit | f83893e4a840cbe77b08bdf09a384b6d22ed1d1c (patch) | |
tree | b6f2839c0503ef5d00d1faff7e5a5ff902487df0 /common/synchronizer.cpp | |
parent | 979276a574e615213891463ab23569f7bbaf07b4 (diff) | |
download | sink-f83893e4a840cbe77b08bdf09a384b6d22ed1d1c.tar.gz sink-f83893e4a840cbe77b08bdf09a384b6d22ed1d1c.zip |
Avoid unnecessary replay requests.
A single request will replay until the latest revision.
Diffstat (limited to 'common/synchronizer.cpp')
-rw-r--r-- | common/synchronizer.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/common/synchronizer.cpp b/common/synchronizer.cpp index cfe1f09..cfd2c10 100644 --- a/common/synchronizer.cpp +++ b/common/synchronizer.cpp | |||
@@ -381,6 +381,12 @@ Sink::Storage::DataStore::DataStore::Transaction &Synchronizer::syncTransaction( | |||
381 | 381 | ||
382 | void Synchronizer::revisionChanged() | 382 | void Synchronizer::revisionChanged() |
383 | { | 383 | { |
384 | //One replay request is enough | ||
385 | for (const auto &r : mSyncRequestQueue) { | ||
386 | if (r.requestType == Synchronizer::SyncRequest::ChangeReplay) { | ||
387 | return; | ||
388 | } | ||
389 | } | ||
384 | mSyncRequestQueue << Synchronizer::SyncRequest{Synchronizer::SyncRequest::ChangeReplay}; | 390 | mSyncRequestQueue << Synchronizer::SyncRequest{Synchronizer::SyncRequest::ChangeReplay}; |
385 | processSyncQueue().exec(); | 391 | processSyncQueue().exec(); |
386 | } | 392 | } |