Skip to content

Commit 9c6ae51

Browse files
author
Pniel (Pini) Cohen
authored
Merge pull request #92 from cloudinary/v1.14.9
v1.14.9: Fixed an issue on BulkUpload
2 parents cd23e6f + 9bbf32b commit 9c6ae51

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

Core/CloudinaryImageManager.php

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,18 +68,17 @@ public function uploadAndSynchronise(Image $image, OutputInterface $output = nul
6868
} catch (\Exception $e) {
6969
if ($e->getMessage() === FileExists::DEFAULT_MESSAGE) {
7070
$this->report($output, sprintf(self::MESSAGE_UPLOADED_EXISTS, $image));
71-
return;
72-
}
71+
} else {
72+
if ($retryAttempt < self::MAXIMUM_RETRY_ATTEMPTS) {
73+
$retryAttempt++;
74+
$this->report($output, sprintf(self::MESSAGE_RETRY, $e->getMessage(), $retryAttempt));
75+
usleep(rand(10, 1000) * 1000);
76+
$this->uploadAndSynchronise($image, $output, $retryAttempt);
77+
return;
78+
}
7379

74-
if ($retryAttempt < self::MAXIMUM_RETRY_ATTEMPTS) {
75-
$retryAttempt++;
76-
$this->report($output, sprintf(self::MESSAGE_RETRY, $e->getMessage(), $retryAttempt));
77-
usleep(rand(10, 1000) * 1000);
78-
$this->uploadAndSynchronise($image, $output, $retryAttempt);
79-
return;
80+
throw $e;
8081
}
81-
82-
throw $e;
8382
}
8483

8584
$this->synchronisationRepository->saveAsSynchronized($image->getRelativePath());

0 commit comments

Comments
 (0)