Skip to content

Commit

Permalink
Fix multiple sync runs error (#512)
Browse files Browse the repository at this point in the history
* fix: change exception reason to UniqueKeyViolation instead of DuplicateIndex

* fix: return DuplicateIndex and UniqueKeyViolation exception reason

* refactor: merge IF cases

* ci: trigger pipelines

---------

Co-authored-by: Nikola Dmitrasinovic <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Feb 6, 2024
1 parent e9602b3 commit 93f7076
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ private async Task<SyncRun> CreateNewSyncRun(IEnumerable<ExternalEvent> events)
}
catch (DbUpdateException ex)
{
if (ex.HasReason(DbUpdateExceptionReason.DuplicateIndex))
if (ex.HasReason(DbUpdateExceptionReason.DuplicateIndex) || ex.HasReason(DbUpdateExceptionReason.UniqueKeyViolation))
throw new OperationFailedException(ApplicationErrors.SyncRuns.CannotStartSyncRunWhenAnotherSyncRunIsRunning());

throw;
Expand Down

0 comments on commit 93f7076

Please sign in to comment.