mirror of
https://github.com/nextcloud/server.git
synced 2026-04-29 01:50:33 -04:00
Merge pull request #45806 from nextcloud/backport/45768/stable27
[stable27] Use isRetryable to catch retryable exceptions
This commit is contained in:
commit
46bc43145d
1 changed files with 6 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
@ -738,7 +738,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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue