Skip to content

Commit e6e89fc

Browse files
committed
switch alias in atomic operation
1 parent 060eeb9 commit e6e89fc

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/Jobs/ActivateIndex.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,8 @@ public function __construct(
1515

1616
public function handle(): void
1717
{
18-
$oldIndex = $this->indexConfig->getBlueGreenActiveElasticaIndex();
1918
$newIndex = $this->indexConfig->getBlueGreenInactiveElasticaIndex();
20-
2119
$newIndex->flush();
22-
$oldIndex->removeAlias($this->indexConfig->getName());
23-
$newIndex->addAlias($this->indexConfig->getName());
24-
$oldIndex->flush();
20+
$newIndex->addAlias($this->indexConfig->getName(), true);
2521
}
2622
}

0 commit comments

Comments
 (0)