Skip to content

Commit 93f7076

Browse files
NikolaVetnicNikolaDmitrasinovicgithub-actions[bot]
authored
Fix multiple sync runs error (#512)
* 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>
1 parent e9602b3 commit 93f7076

File tree

1 file changed

+1
-1
lines changed
  • Modules/Synchronization/src/Synchronization.Application/SyncRuns/Commands/StartSyncRun

1 file changed

+1
-1
lines changed

Modules/Synchronization/src/Synchronization.Application/SyncRuns/Commands/StartSyncRun/Handler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ private async Task<SyncRun> CreateNewSyncRun(IEnumerable<ExternalEvent> events)
133133
}
134134
catch (DbUpdateException ex)
135135
{
136-
if (ex.HasReason(DbUpdateExceptionReason.DuplicateIndex))
136+
if (ex.HasReason(DbUpdateExceptionReason.DuplicateIndex) || ex.HasReason(DbUpdateExceptionReason.UniqueKeyViolation))
137137
throw new OperationFailedException(ApplicationErrors.SyncRuns.CannotStartSyncRunWhenAnotherSyncRunIsRunning());
138138

139139
throw;

0 commit comments

Comments
 (0)