summaryrefslogtreecommitdiffstats
path: root/common/pipeline.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-12-06 19:40:33 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-12-06 19:40:33 +0100
commitf425c2070131161dc11bcf70e35f8d1848cadb65 (patch)
tree953e6f0a8c409bb5c8485d8acb0d0eb0b7f08e44 /common/pipeline.cpp
parent20b76fc1fd539bf95b8cb0d0ea7044718ec99972 (diff)
downloadsink-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.cpp10
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();