mirror of
https://github.com/nextcloud/server.git
synced 2026-03-04 18:28:08 +01:00
fix(files): Use isRetryable to catch retryable exceptions
Signed-off-by: Louis Chemineau <louis@chmn.me>
This commit is contained in:
committed by
backportbot[bot]
parent
a51237a7a1
commit
b7cd197315
@@ -40,8 +40,8 @@
|
||||
|
||||
namespace OC\Files\Cache;
|
||||
|
||||
use Doctrine\DBAL\Exception\RetryableException;
|
||||
use Doctrine\DBAL\Exception\UniqueConstraintViolationException;
|
||||
use OC\DB\Exceptions\DbalException;
|
||||
use OC\Files\Search\SearchComparison;
|
||||
use OC\Files\Search\SearchQuery;
|
||||
use OC\Files\Storage\Wrapper\Encryption;
|
||||
@@ -729,7 +729,11 @@ class Cache implements ICache {
|
||||
} catch (\OC\DatabaseException $e) {
|
||||
$this->connection->rollBack();
|
||||
throw $e;
|
||||
} catch (RetryableException $e) {
|
||||
} catch (DbalException $e) {
|
||||
if (!$e->isRetryable()) {
|
||||
throw $e;
|
||||
}
|
||||
|
||||
// Simply throw if we already retried 4 times.
|
||||
if ($i === $retryLimit) {
|
||||
throw $e;
|
||||
|
||||
Reference in New Issue
Block a user