Skip to content

Commit 1465f81

Browse files
committed
more configurable options
1 parent 9faab2a commit 1465f81

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

config/elastica-bridge.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@
66
'port' => env('ELASTICSEARCH_PORT', '9200'),
77
],
88
'indices' => [],
9+
'queue' => env('ELASTICSEARCH_QUEUE', config('queue.default')),
910
];

src/Commands/IndexCommand.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,14 @@ public function handle()
5555

5656
$this->info(sprintf('Indexing %s', $indexConfig->getName()));
5757

58-
dispatch(new SetupIndex($indexConfig, (bool) $this->option('delete')));
59-
6058
Bus::batch([
61-
[new PopulateIndex($indexConfig)],
62-
])
59+
[new SetupIndex($indexConfig, (bool) $this->option('delete'))],
60+
[new PopulateIndex($indexConfig)],
61+
])
62+
->onQueue(config('elastica-bridge.queue'))
6363
->then(function () use ($indexConfig): void {
64-
dispatch(new ActivateIndex($indexConfig));
64+
ActivateIndex::dispatch($indexConfig)
65+
->onQueue(config('elastica-bridge.queue'));
6566
})
6667
->name('ES index: '.$indexConfig->getName())
6768
->dispatch();

0 commit comments

Comments
 (0)