From 536d1cc26acb32d63d6a8986c55812cff3e6c20e Mon Sep 17 00:00:00 2001 From: Louis Chemineau Date: Mon, 10 Jun 2024 18:01:39 +0200 Subject: [PATCH] fix(files): Use isRetryable to catch retryable exceptions Signed-off-by: Louis Chemineau --- lib/private/Files/Cache/Cache.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/private/Files/Cache/Cache.php b/lib/private/Files/Cache/Cache.php index 1b79e5a648e92..b148e0f7476de 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; @@ -732,7 +732,11 @@ public function moveFromCache(ICache $sourceCache, $sourcePath, $targetPath) { } 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;