Skip to content

Commit 85d46fe

Browse files
authored
Merge pull request #45808 from nextcloud/backport/45768/stable29
[stable29] Use isRetryable to catch retryable exceptions
2 parents ba46d03 + b7cd197 commit 85d46fe

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

lib/private/Files/Cache/Cache.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040

4141
namespace OC\Files\Cache;
4242

43-
use Doctrine\DBAL\Exception\RetryableException;
4443
use Doctrine\DBAL\Exception\UniqueConstraintViolationException;
44+
use OC\DB\Exceptions\DbalException;
4545
use OC\Files\Search\SearchComparison;
4646
use OC\Files\Search\SearchQuery;
4747
use OC\Files\Storage\Wrapper\Encryption;
@@ -729,7 +729,11 @@ public function moveFromCache(ICache $sourceCache, $sourcePath, $targetPath) {
729729
} catch (\OC\DatabaseException $e) {
730730
$this->connection->rollBack();
731731
throw $e;
732-
} catch (RetryableException $e) {
732+
} catch (DbalException $e) {
733+
if (!$e->isRetryable()) {
734+
throw $e;
735+
}
736+
733737
// Simply throw if we already retried 4 times.
734738
if ($i === $retryLimit) {
735739
throw $e;

0 commit comments

Comments
 (0)