diff options
author | Louis Chemineau <louis@chmn.me> | 2024-06-10 18:01:39 +0200 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2024-06-12 08:13:20 +0000 |
commit | 3da39308cd2e6bbc5ab55f95f5971069c577a91f (patch) | |
tree | cda3305f8dd604289a1f1838de162ba9e73229fe | |
parent | 5bad00d37f45df9da122f558ca3482fdd0006a3e (diff) | |
download | nextcloud-server-3da39308cd2e6bbc5ab55f95f5971069c577a91f.tar.gz nextcloud-server-3da39308cd2e6bbc5ab55f95f5971069c577a91f.zip |
fix(files): Use isRetryable to catch retryable exceptions
Signed-off-by: Louis Chemineau <louis@chmn.me>
-rw-r--r-- | lib/private/Files/Cache/Cache.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/private/Files/Cache/Cache.php b/lib/private/Files/Cache/Cache.php index 9822b6874f9..26572af2346 100644 --- a/lib/private/Files/Cache/Cache.php +++ b/lib/private/Files/Cache/Cache.php @@ -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; @@ -738,7 +738,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; |