Skip to content

Commit 23f5f27

Browse files
Resolve danielgerlag#957, Add back MongoBulkWriteException
1 parent 3066e05 commit 23f5f27

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/providers/WorkflowCore.Persistence.MongoDB/Services/MongoPersistenceProvider.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,12 @@ public async Task ScheduleCommand(ScheduledCommand command)
321321
return;
322322
throw;
323323
}
324+
catch (MongoBulkWriteException ex)
325+
{
326+
if (ex.WriteErrors.All(x => x.Category == ServerErrorCategory.DuplicateKey))
327+
return;
328+
throw;
329+
}
324330
}
325331

326332
public async Task ProcessCommands(DateTimeOffset asOf, Func<ScheduledCommand, Task> action, CancellationToken cancellationToken = default)

0 commit comments

Comments
 (0)