diff options
author | Louis <louis@chmn.me> | 2024-06-12 10:08:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-12 10:08:46 +0200 |
commit | f626476b11c25ab002e95d2c8ae54fc802bdf185 (patch) | |
tree | faa8c6ff7394515c9e94f00d95fd3f2260841e06 | |
parent | 0b10f2d478376c6d67add2f200bab8c108ce344c (diff) | |
parent | a93d3a5a10abfd5e8ae138d5f934b7d679021582 (diff) | |
download | nextcloud-server-f626476b11c25ab002e95d2c8ae54fc802bdf185.tar.gz nextcloud-server-f626476b11c25ab002e95d2c8ae54fc802bdf185.zip |
Merge pull request #45768 from nextcloud/artonge/fix/copy_retry
Use isRetryable to catch retryable exceptions
-rw-r--r-- | lib/private/Files/Cache/Cache.php | 8 |
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; |