Skip to content

Commit 1b8fee1

Browse files
committed
fix
1 parent eca17d8 commit 1b8fee1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Jobs/SetupIndex.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@
44

55
namespace Limenet\LaravelElasticaBridge\Jobs;
66

7+
use Illuminate\Bus\Batchable;
78
use Limenet\LaravelElasticaBridge\Client\ElasticaClient;
89
use Limenet\LaravelElasticaBridge\Exception\Index\BlueGreenIndicesIncorrectlySetupException;
910
use Limenet\LaravelElasticaBridge\Index\IndexInterface;
1011

1112
class SetupIndex extends AbstractIndexJob
1213
{
14+
use Batchable;
1315
/**
1416
* Create a new job instance.
1517
*
@@ -25,6 +27,10 @@ public function __construct(protected IndexInterface $indexConfig, protected boo
2527
*/
2628
public function handle(ElasticaClient $elastica): void
2729
{
30+
if ($this->batch()->cancelled()) {
31+
return;
32+
}
33+
2834
foreach (IndexInterface::INDEX_SUFFIXES as $suffix) {
2935
$name = $this->indexConfig->getName().$suffix;
3036
$aliasIndex = $elastica->getIndex($name);

0 commit comments

Comments
 (0)