diff --git a/lib/private/Files/Cache/Cache.php b/lib/private/Files/Cache/Cache.php index 5267b8a815392..5be524898cd77 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; @@ -729,7 +729,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;