Skip to content

Commit

Permalink
Merge pull request #45807 from nextcloud/backport/45768/stable28
Browse files Browse the repository at this point in the history
[stable28] Use isRetryable to catch retryable exceptions
  • Loading branch information
blizzz authored Jun 13, 2024
2 parents 683ae3c + 536d1cc commit c23002b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/private/Files/Cache/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit c23002b

Please sign in to comment.