diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-12-12 18:19:45 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-12-12 18:19:45 +0100 |
commit | 9f134cc8cb634ea67185874c91e1a30d9c1bad95 (patch) | |
tree | 59616586150fac718b5a707f29989608867828c2 | |
parent | 23bf1faa326a2bd1ed1f2a697474800c4d9ab952 (diff) | |
download | sink-9f134cc8cb634ea67185874c91e1a30d9c1bad95.tar.gz sink-9f134cc8cb634ea67185874c91e1a30d9c1bad95.zip |
We want the sync to be blocking
... which is only possible if we flush
after issuing the sync.
-rw-r--r-- | sinksh/syntax_modules/sink_sync.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sinksh/syntax_modules/sink_sync.cpp b/sinksh/syntax_modules/sink_sync.cpp index 1c7ed0f..d4a0e1c 100644 --- a/sinksh/syntax_modules/sink_sync.cpp +++ b/sinksh/syntax_modules/sink_sync.cpp | |||
@@ -23,6 +23,7 @@ | |||
23 | 23 | ||
24 | #include "common/resource.h" | 24 | #include "common/resource.h" |
25 | #include "common/storage.h" | 25 | #include "common/storage.h" |
26 | #include "common/resourcecontrol.h" | ||
26 | #include "common/domain/event.h" | 27 | #include "common/domain/event.h" |
27 | #include "common/domain/folder.h" | 28 | #include "common/domain/folder.h" |
28 | #include "common/resourceconfig.h" | 29 | #include "common/resourceconfig.h" |
@@ -45,7 +46,9 @@ bool sync(const QStringList &args, State &state) | |||
45 | } | 46 | } |
46 | 47 | ||
47 | QTimer::singleShot(0, [query, state]() { | 48 | QTimer::singleShot(0, [query, state]() { |
48 | Sink::Store::synchronize(query).syncThen<void>([state](const KAsync::Error &error) { | 49 | Sink::Store::synchronize(query) |
50 | .then(Sink::ResourceControl::flushReplayQueue(query.getResourceFilter().ids)) | ||
51 | .syncThen<void>([state](const KAsync::Error &error) { | ||
49 | if (error) { | 52 | if (error) { |
50 | state.printLine("Synchronization failed!"); | 53 | state.printLine("Synchronization failed!"); |
51 | } else { | 54 | } else { |