diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-12-06 19:40:33 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-12-06 19:40:33 +0100 |
commit | f425c2070131161dc11bcf70e35f8d1848cadb65 (patch) | |
tree | 953e6f0a8c409bb5c8485d8acb0d0eb0b7f08e44 /common/pipeline.cpp | |
parent | 20b76fc1fd539bf95b8cb0d0ea7044718ec99972 (diff) | |
download | sink-f425c2070131161dc11bcf70e35f8d1848cadb65.tar.gz sink-f425c2070131161dc11bcf70e35f8d1848cadb65.zip |
Interresourcemovetest/fixed interresourcemove
We cant take the identifier from the entity where we just cleared the
identifier.
Diffstat (limited to 'common/pipeline.cpp')
-rw-r--r-- | common/pipeline.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/common/pipeline.cpp b/common/pipeline.cpp index 4ea43eb..7ee4b91 100644 --- a/common/pipeline.cpp +++ b/common/pipeline.cpp | |||
@@ -277,22 +277,22 @@ KAsync::Job<qint64> Pipeline::modifiedEntity(void const *command, size_t size) | |||
277 | 277 | ||
278 | SinkTrace() << "Moving entity to new resource " << newEntity.identifier() << newEntity.resourceInstanceIdentifier() << targetResource; | 278 | SinkTrace() << "Moving entity to new resource " << newEntity.identifier() << newEntity.resourceInstanceIdentifier() << targetResource; |
279 | auto job = TypeHelper<CreateHelper>{bufferType}.operator()<KAsync::Job<void>, ApplicationDomain::ApplicationDomainType&>(newEntity); | 279 | auto job = TypeHelper<CreateHelper>{bufferType}.operator()<KAsync::Job<void>, ApplicationDomain::ApplicationDomainType&>(newEntity); |
280 | job = job.syncThen<void>([this, newEntity, isMove, targetResource, bufferType](const KAsync::Error &error) { | 280 | job = job.syncThen<void>([this, current, isMove, targetResource, bufferType](const KAsync::Error &error) { |
281 | if (!error) { | 281 | if (!error) { |
282 | SinkTrace() << "Move of " << newEntity.identifier() << "was successfull"; | 282 | SinkTrace() << "Move of " << current.identifier() << "was successfull"; |
283 | if (isMove) { | 283 | if (isMove) { |
284 | startTransaction(); | 284 | startTransaction(); |
285 | flatbuffers::FlatBufferBuilder fbb; | 285 | flatbuffers::FlatBufferBuilder fbb; |
286 | auto entityId = fbb.CreateString(newEntity.identifier()); | 286 | auto entityId = fbb.CreateString(current.identifier()); |
287 | auto type = fbb.CreateString(bufferType); | 287 | auto type = fbb.CreateString(bufferType); |
288 | auto location = Sink::Commands::CreateDeleteEntity(fbb, newEntity.revision(), entityId, type, true); | 288 | auto location = Sink::Commands::CreateDeleteEntity(fbb, current.revision(), entityId, type, true); |
289 | Sink::Commands::FinishDeleteEntityBuffer(fbb, location); | 289 | Sink::Commands::FinishDeleteEntityBuffer(fbb, location); |
290 | const auto data = BufferUtils::extractBuffer(fbb); | 290 | const auto data = BufferUtils::extractBuffer(fbb); |
291 | deletedEntity(data, data.size()).exec(); | 291 | deletedEntity(data, data.size()).exec(); |
292 | commit(); | 292 | commit(); |
293 | } | 293 | } |
294 | } else { | 294 | } else { |
295 | SinkError() << "Failed to move entity " << targetResource << " to resource " << newEntity.identifier(); | 295 | SinkError() << "Failed to move entity " << targetResource << " to resource " << current.identifier(); |
296 | } | 296 | } |
297 | }); | 297 | }); |
298 | job.exec(); | 298 | job.exec(); |