diff options
author | Louis Chemineau <louis@chmn.me> | 2024-06-10 18:01:39 +0200 |
---|---|---|
committer | Louis <louis@chmn.me> | 2024-06-11 15:15:14 +0200 |
commit | a93d3a5a10abfd5e8ae138d5f934b7d679021582 (patch) | |
tree | 69b550b7249fec8ef3d839f7e54525e83f4a3e89 /lib | |
parent | 81e90ae592ffb48e4420e235729494ebc01b44b4 (diff) | |
download | nextcloud-server-a93d3a5a10abfd5e8ae138d5f934b7d679021582.tar.gz nextcloud-server-a93d3a5a10abfd5e8ae138d5f934b7d679021582.zip |
fix(files): Use isRetryable to catch retryable exceptions
Signed-off-by: Louis Chemineau <louis@chmn.me>
Diffstat (limited to 'lib')
-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 6c4bd2c9637..96e840e4806 100644 --- a/lib/private/Files/Cache/Cache.php +++ b/lib/private/Files/Cache/Cache.php @@ -7,8 +7,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; @@ -696,7 +696,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; |