Skip to content

Commit 44c9b74

Browse files
committed
MERGE: Merge branch '3.0' into bugfix/14-realtime-removal
2 parents 38bd2e8 + db61678 commit 44c9b74

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

Classes/Command/NodeIndexQueueCommandController.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
/**
2121
* Provides CLI features for index handling
22+
*
2223
* @Flow\Scope("singleton")
2324
*/
2425
class NodeIndexQueueCommandController extends CommandController
@@ -27,6 +28,7 @@ class NodeIndexQueueCommandController extends CommandController
2728

2829
const BATCH_QUEUE_NAME = 'Flowpack.ElasticSearch.ContentRepositoryQueueIndexer';
2930
const LIVE_QUEUE_NAME = 'Flowpack.ElasticSearch.ContentRepositoryQueueIndexer.Live';
31+
const DEFAULT_BATCH_SIZE = 500;
3032

3133
/**
3234
* @var JobManager
@@ -70,6 +72,12 @@ class NodeIndexQueueCommandController extends CommandController
7072
*/
7173
protected $nodeIndexer;
7274

75+
/**
76+
* @Flow\InjectConfiguration(package="Flowpack.ElasticSearch.ContentRepositoryQueueIndexer")
77+
* @var array
78+
*/
79+
protected $settings;
80+
7381
/**
7482
* Index all nodes by creating a new index and when everything was completed, switch the index alias.
7583
*
@@ -220,7 +228,7 @@ protected function indexWorkspace($workspaceName, $indexPostfix)
220228
$this->outputLine('<info>++</info> Indexing %s workspace', [$workspaceName]);
221229
$nodeCounter = 0;
222230
$offset = 0;
223-
$batchSize = 100;
231+
$batchSize = $this->settings['batchSize'] ?? static::DEFAULT_BATCH_SIZE;
224232
while (true) {
225233
$iterator = $this->nodeDataRepository->findAllBySiteAndWorkspace($workspaceName, $offset, $batchSize);
226234

Configuration/Settings.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ Flowpack:
22
ElasticSearch:
33
ContentRepositoryQueueIndexer:
44
enableLiveAsyncIndexing: true
5-
5+
# Change size of single batch jobs via this setting (fallback default is 500)
6+
# batchSize: 50
67
JobQueue:
78
Common:
89
queues:

0 commit comments

Comments
 (0)