Skip to content

Commit 6a04335

Browse files
committed
TASK: Clarify the "workspace" used in IndexingJob
1 parent 40c0ba5 commit 6a04335

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

Classes/Flowpack/ElasticSearch/ContentRepositoryQueueIndexer/Indexer/NodeIndexer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class NodeIndexer extends ContentRepositoryAdaptor\Indexer\NodeIndexer
3434

3535
/**
3636
* @param NodeInterface $node
37-
* @param string|null $targetWorkspaceName
37+
* @param string|null $targetWorkspaceName In case indexing is triggered during publishing, a target workspace name will be passed in
3838
*/
3939
public function indexNode(NodeInterface $node, $targetWorkspaceName = null)
4040
{

Classes/Flowpack/ElasticSearch/ContentRepositoryQueueIndexer/IndexingJob.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Flowpack\JobQueue\Common\Job\JobInterface;
77
use Flowpack\JobQueue\Common\Queue\Message;
88
use Flowpack\JobQueue\Common\Queue\QueueInterface;
9+
use Neos\ContentRepository\Domain\Model\NodeData;
910
use Neos\Flow\Annotations as Flow;
1011
use Neos\Flow\Log\SystemLoggerInterface;
1112
use Neos\Flow\Utility\Algorithms;
@@ -52,7 +53,7 @@ class IndexingJob implements JobInterface
5253
/**
5354
* @var string
5455
*/
55-
protected $workspaceName;
56+
protected $targetWorkspaceName;
5657

5758
/**
5859
* @var string
@@ -66,13 +67,13 @@ class IndexingJob implements JobInterface
6667

6768
/**
6869
* @param string $indexPostfix
69-
* @param string $workspaceName
70+
* @param string $targetWorkspaceName In case indexing is triggered during publishing, a target workspace name will be passed in
7071
* @param array $nodes
7172
*/
72-
public function __construct($indexPostfix, $workspaceName, array $nodes)
73+
public function __construct($indexPostfix, $targetWorkspaceName, array $nodes)
7374
{
7475
$this->identifier = Algorithms::generateRandomString(24);
75-
$this->workspaceName = $workspaceName;
76+
$this->targetWorkspaceName = $targetWorkspaceName;
7677
$this->indexPostfix = $indexPostfix;
7778
$this->nodes = $nodes;
7879
}
@@ -94,7 +95,7 @@ public function execute(QueueInterface $queue, Message $message)
9495
/** @var NodeData $nodeData */
9596
$nodeData = $this->nodeDataRepository->findByIdentifier($node['nodeIdentifier']);
9697
$context = $this->contextFactory->create([
97-
'workspaceName' => $this->workspaceName,
98+
'workspaceName' => $this->targetWorkspaceName,
9899
'invisibleContentShown' => true,
99100
'inaccessibleContentShown' => false,
100101
'dimensions' => $node['dimensions']

0 commit comments

Comments
 (0)