aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLouis Chemineau <louis@chmn.me>2024-06-10 18:01:39 +0200
committerLouis <louis@chmn.me>2024-06-11 15:15:14 +0200
commita93d3a5a10abfd5e8ae138d5f934b7d679021582 (patch)
tree69b550b7249fec8ef3d839f7e54525e83f4a3e89 /lib
parent81e90ae592ffb48e4420e235729494ebc01b44b4 (diff)
downloadnextcloud-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.php8
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;