|
40 | 40 |
|
41 | 41 | namespace OC\Files\Cache; |
42 | 42 |
|
43 | | -use Doctrine\DBAL\Exception\RetryableException; |
44 | 43 | use Doctrine\DBAL\Exception\UniqueConstraintViolationException; |
45 | 44 | use OC\Files\Search\SearchComparison; |
46 | 45 | use OC\Files\Search\SearchQuery; |
@@ -715,28 +714,12 @@ public function moveFromCache(ICache $sourceCache, $sourcePath, $targetPath) { |
715 | 714 | $query->set('encrypted', $query->createNamedParameter(0, IQueryBuilder::PARAM_INT)); |
716 | 715 | } |
717 | 716 |
|
718 | | - // Retry transaction in case of RetryableException like deadlocks. |
719 | | - // Retry up to 4 times because we should receive up to 4 concurrent requests from the frontend |
720 | | - $retryLimit = 4; |
721 | | - for ($i = 1; $i <= $retryLimit; $i++) { |
722 | | - try { |
723 | | - $this->connection->beginTransaction(); |
724 | | - $query->executeStatement(); |
725 | | - break; |
726 | | - } catch (\OC\DatabaseException $e) { |
727 | | - $this->connection->rollBack(); |
728 | | - throw $e; |
729 | | - } catch (RetryableException $e) { |
730 | | - // Simply throw if we already retried 4 times. |
731 | | - if ($i === $retryLimit) { |
732 | | - throw $e; |
733 | | - } |
734 | | - |
735 | | - $this->connection->rollBack(); |
736 | | - |
737 | | - // Sleep a bit to give some time to the other transaction to finish. |
738 | | - usleep(100 * 1000 * $i); |
739 | | - } |
| 717 | + try { |
| 718 | + $this->connection->beginTransaction(); |
| 719 | + $query->executeStatement(4); |
| 720 | + } catch (\OC\DatabaseException $e) { |
| 721 | + $this->connection->rollBack(); |
| 722 | + throw $e; |
740 | 723 | } |
741 | 724 | } else { |
742 | 725 | $this->connection->beginTransaction(); |
|
0 commit comments