From 9f134cc8cb634ea67185874c91e1a30d9c1bad95 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Mon, 12 Dec 2016 18:19:45 +0100 Subject: We want the sync to be blocking ... which is only possible if we flush after issuing the sync. --- sinksh/syntax_modules/sink_sync.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sinksh/syntax_modules/sink_sync.cpp') 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 @@ #include "common/resource.h" #include "common/storage.h" +#include "common/resourcecontrol.h" #include "common/domain/event.h" #include "common/domain/folder.h" #include "common/resourceconfig.h" @@ -45,7 +46,9 @@ bool sync(const QStringList &args, State &state) } QTimer::singleShot(0, [query, state]() { - Sink::Store::synchronize(query).syncThen([state](const KAsync::Error &error) { + Sink::Store::synchronize(query) + .then(Sink::ResourceControl::flushReplayQueue(query.getResourceFilter().ids)) + .syncThen([state](const KAsync::Error &error) { if (error) { state.printLine("Synchronization failed!"); } else { -- cgit v1.2.3