diff options
Diffstat (limited to 'common/changereplay.cpp')
-rw-r--r-- | common/changereplay.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/common/changereplay.cpp b/common/changereplay.cpp index 4870551..6b4540e 100644 --- a/common/changereplay.cpp +++ b/common/changereplay.cpp | |||
@@ -29,8 +29,9 @@ | |||
29 | using namespace Sink; | 29 | using namespace Sink; |
30 | using namespace Sink::Storage; | 30 | using namespace Sink::Storage; |
31 | 31 | ||
32 | ChangeReplay::ChangeReplay(const ResourceContext &resourceContext) | 32 | ChangeReplay::ChangeReplay(const ResourceContext &resourceContext, const Sink::Log::Context &ctx) |
33 | : mStorage(storageLocation(), resourceContext.instanceId(), DataStore::ReadOnly), mChangeReplayStore(storageLocation(), resourceContext.instanceId() + ".changereplay", DataStore::ReadWrite), mReplayInProgress(false), mLogCtx{"changereplay"} | 33 | : mStorage(storageLocation(), resourceContext.instanceId(), DataStore::ReadOnly), mChangeReplayStore(storageLocation(), resourceContext.instanceId() + ".changereplay", DataStore::ReadWrite), mReplayInProgress(false), mLogCtx{ctx.subContext("changereplay")}, |
34 | mGuard{new QObject} | ||
34 | { | 35 | { |
35 | SinkTraceCtx(mLogCtx) << "Created change replay: " << resourceContext.instanceId(); | 36 | SinkTraceCtx(mLogCtx) << "Created change replay: " << resourceContext.instanceId(); |
36 | } | 37 | } |
@@ -100,10 +101,11 @@ KAsync::Job<void> ChangeReplay::replayNextRevision() | |||
100 | return KAsync::doWhile( | 101 | return KAsync::doWhile( |
101 | [this, lastReplayedRevision, topRevision]() -> KAsync::Job<KAsync::ControlFlowFlag> { | 102 | [this, lastReplayedRevision, topRevision]() -> KAsync::Job<KAsync::ControlFlowFlag> { |
102 | if (!mGuard) { | 103 | if (!mGuard) { |
104 | SinkTraceCtx(mLogCtx) << "Exit due to guard"; | ||
103 | return KAsync::value(KAsync::Break); | 105 | return KAsync::value(KAsync::Break); |
104 | } | 106 | } |
105 | if (*lastReplayedRevision >= *topRevision) { | 107 | if (*lastReplayedRevision >= *topRevision) { |
106 | SinkTraceCtx(mLogCtx) << "Done replaying"; | 108 | SinkTraceCtx(mLogCtx) << "Done replaying" << *lastReplayedRevision << *topRevision; |
107 | return KAsync::value(KAsync::Break); | 109 | return KAsync::value(KAsync::Break); |
108 | } | 110 | } |
109 | 111 | ||