abort updates once it fails
This commit is contained in:
parent
48c4bb779e
commit
239b7773c2
@ -47,14 +47,10 @@ class EpisodeActionSaver
|
|||||||
try {
|
try {
|
||||||
$episodeActionEntities[] = $this->episodeActionWriter->save($episodeActionEntity);
|
$episodeActionEntities[] = $this->episodeActionWriter->save($episodeActionEntity);
|
||||||
} catch (UniqueConstraintViolationException $uniqueConstraintViolationException) {
|
} catch (UniqueConstraintViolationException $uniqueConstraintViolationException) {
|
||||||
try {
|
|
||||||
$episodeActionEntities[] = $this->updateEpisodeAction($episodeActionEntity, $userId);
|
$episodeActionEntities[] = $this->updateEpisodeAction($episodeActionEntity, $userId);
|
||||||
} catch (Exception $exception) {}
|
|
||||||
} catch (Exception $exception) {
|
} catch (Exception $exception) {
|
||||||
if ($exception->getReason() === Exception::REASON_UNIQUE_CONSTRAINT_VIOLATION) {
|
if ($exception->getReason() === Exception::REASON_UNIQUE_CONSTRAINT_VIOLATION) {
|
||||||
try {
|
|
||||||
$episodeActionEntities[] = $this->updateEpisodeAction($episodeActionEntity, $userId);
|
$episodeActionEntities[] = $this->updateEpisodeAction($episodeActionEntity, $userId);
|
||||||
} catch (Exception $exception) {}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -67,9 +63,6 @@ class EpisodeActionSaver
|
|||||||
->format("U");
|
->format("U");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
|
||||||
private function updateEpisodeAction(
|
private function updateEpisodeAction(
|
||||||
EpisodeActionEntity $episodeActionEntity,
|
EpisodeActionEntity $episodeActionEntity,
|
||||||
string $userId
|
string $userId
|
||||||
|
Loading…
Reference in New Issue
Block a user