Browse Source
Merge pull request #45768 from nextcloud/artonge/fix/copy_retry
Use isRetryable to catch retryable exceptions
pull/45811/head
Louis
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
6 additions and
2 deletions
-
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; |
|
|
|
|