Skip to content

Commit a99c61d

Browse files
committed
TASK: Add more information in the Removal and Indexing Job
This change add context patch and node type to both job payload, to be able to create a fake node if the node as been deleted in between.
1 parent 8c256bf commit a99c61d

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

Classes/Command/NodeIndexQueueCommandController.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,8 @@ protected function indexWorkspace($workspaceName, $indexPostfix)
219219
foreach ($this->nodeDataRepository->iterate($iterator) as $data) {
220220
$jobData[] = [
221221
'nodeIdentifier' => $data['nodeIdentifier'],
222-
'dimensions' => $data['dimensions']
222+
'dimensions' => $data['dimensions'],
223+
'nodeType' => $data['nodeType'],
223224
];
224225
$nodeCounter++;
225226
}

Classes/Indexer/NodeIndexer.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ public function indexNode(NodeInterface $node, $targetWorkspaceName = null)
4646
$indexingJob = new IndexingJob($this->indexNamePostfix, $targetWorkspaceName, [
4747
[
4848
'nodeIdentifier' => $this->persistenceManager->getIdentifierByObject($node->getNodeData()),
49-
'dimensions' => $node->getDimensions()
49+
'dimensions' => $node->getDimensions(),
50+
'nodeType' => $node->getNodeType()->getName(),
51+
'contextPath' => $node->getContextPath(),
5052
]
5153
]);
5254
$this->jobManager->queue(NodeIndexQueueCommandController::LIVE_QUEUE_NAME, $indexingJob);
@@ -65,7 +67,9 @@ public function removeNode(NodeInterface $node, $targetWorkspaceName = null)
6567
$removalJob = new RemovalJob($this->indexNamePostfix, $targetWorkspaceName, [
6668
[
6769
'nodeIdentifier' => $this->persistenceManager->getIdentifierByObject($node->getNodeData()),
68-
'dimensions' => $node->getDimensions()
70+
'dimensions' => $node->getDimensions(),
71+
'nodeType' => $node->getNodeType()->getName(),
72+
'contextPath' => $node->getContextPath(),
6973
]
7074
]);
7175
$this->jobManager->queue(NodeIndexQueueCommandController::LIVE_QUEUE_NAME, $removalJob);

0 commit comments

Comments
 (0)