Skip to content

Commit 946be51

Browse files
committed
release lock in catch block
1 parent c83dacf commit 946be51

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Commands/IndexCommand.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ public function handle(): int
5959
ActivateIndex::dispatch($indexConfig)
6060
->onConnection(config('elastica-bridge.connection'));
6161
})
62+
->catch(function () use ($indexConfig): void {
63+
$indexConfig->indexingLock()->forceRelease();
64+
})
6265
->finally(function () use ($indexConfig): void {
6366
$indexConfig->indexingLock()->forceRelease();
6467
})

0 commit comments

Comments
 (0)