Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0d1e93a

Browse files
committed
Handle store exception on exists check
1 parent b47b239 commit 0d1e93a

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/Symfony/Component/Lock/Store/CombinedStore.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,14 @@ public function exists(Key $key)
199199
$storesCount = \count($this->stores);
200200

201201
foreach ($this->stores as $store) {
202-
if ($store->exists($key)) {
203-
++$successCount;
204-
} else {
202+
try {
203+
if($store->exists($key)){
204+
++$successCount;
205+
} else {
206+
++$failureCount;
207+
}
208+
} catch (\Exception $e){
209+
$this->logger->debug('One store failed to check the "{resource}" lock.', ['resource' => $key, 'store' => $store, 'exception' => $e]);
205210
++$failureCount;
206211
}
207212

0 commit comments

Comments
 (0)