diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/genericresource.cpp | 6 | ||||
-rw-r--r-- | common/genericresource.h | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/common/genericresource.cpp b/common/genericresource.cpp index 42153ec..29acce4 100644 --- a/common/genericresource.cpp +++ b/common/genericresource.cpp | |||
@@ -282,7 +282,9 @@ GenericResource::GenericResource(const QByteArray &resourceInstanceIdentifier, c | |||
282 | QObject::connect(mProcessor, &CommandProcessor::error, [this](int errorCode, const QString &msg) { onProcessorError(errorCode, msg); }); | 282 | QObject::connect(mProcessor, &CommandProcessor::error, [this](int errorCode, const QString &msg) { onProcessorError(errorCode, msg); }); |
283 | QObject::connect(mPipeline.data(), &Pipeline::revisionUpdated, this, &Resource::revisionUpdated); | 283 | QObject::connect(mPipeline.data(), &Pipeline::revisionUpdated, this, &Resource::revisionUpdated); |
284 | mSourceChangeReplay = new ChangeReplay(resourceInstanceIdentifier, [this](const QByteArray &type, const QByteArray &key, const QByteArray &value) { | 284 | mSourceChangeReplay = new ChangeReplay(resourceInstanceIdentifier, [this](const QByteArray &type, const QByteArray &key, const QByteArray &value) { |
285 | return this->replay(type, key, value); | 285 | //This results in a deadlock when a sync is in progress and we try to create a second writing transaction (which is why we turn changereplay off during the sync) |
286 | auto synchronizationStore = QSharedPointer<Akonadi2::Storage>::create(Akonadi2::storageLocation(), mResourceInstanceIdentifier + ".synchronization", Akonadi2::Storage::ReadWrite); | ||
287 | return this->replay(*synchronizationStore, type, key, value).then<void>([synchronizationStore](){}); | ||
286 | }); | 288 | }); |
287 | enableChangeReplay(true); | 289 | enableChangeReplay(true); |
288 | mClientLowerBoundRevision = mPipeline->cleanedUpRevision(); | 290 | mClientLowerBoundRevision = mPipeline->cleanedUpRevision(); |
@@ -317,7 +319,7 @@ void GenericResource::addType(const QByteArray &type, DomainTypeAdaptorFactoryIn | |||
317 | mPipeline->setAdaptorFactory(type, factory); | 319 | mPipeline->setAdaptorFactory(type, factory); |
318 | } | 320 | } |
319 | 321 | ||
320 | KAsync::Job<void> GenericResource::replay(const QByteArray &type, const QByteArray &key, const QByteArray &value) | 322 | KAsync::Job<void> GenericResource::replay(Akonadi2::Storage &synchronizationStore, const QByteArray &type, const QByteArray &key, const QByteArray &value) |
321 | { | 323 | { |
322 | return KAsync::null<void>(); | 324 | return KAsync::null<void>(); |
323 | } | 325 | } |
diff --git a/common/genericresource.h b/common/genericresource.h index c12c631..f47c6f8 100644 --- a/common/genericresource.h +++ b/common/genericresource.h | |||
@@ -60,7 +60,7 @@ private Q_SLOTS: | |||
60 | protected: | 60 | protected: |
61 | void enableChangeReplay(bool); | 61 | void enableChangeReplay(bool); |
62 | void addType(const QByteArray &type, DomainTypeAdaptorFactoryInterface::Ptr factory, const QVector<Akonadi2::Preprocessor*> &preprocessors); | 62 | void addType(const QByteArray &type, DomainTypeAdaptorFactoryInterface::Ptr factory, const QVector<Akonadi2::Preprocessor*> &preprocessors); |
63 | virtual KAsync::Job<void> replay(const QByteArray &type, const QByteArray &key, const QByteArray &value); | 63 | virtual KAsync::Job<void> replay(Akonadi2::Storage &synchronizationStore, const QByteArray &type, const QByteArray &key, const QByteArray &value); |
64 | void onProcessorError(int errorCode, const QString &errorMessage); | 64 | void onProcessorError(int errorCode, const QString &errorMessage); |
65 | void enqueueCommand(MessageQueue &mq, int commandId, const QByteArray &data); | 65 | void enqueueCommand(MessageQueue &mq, int commandId, const QByteArray &data); |
66 | 66 | ||