Skip to content

Commit 3066e05

Browse files
Resolve danielgerlag#957, E11000 duplicate key error
1 parent df27a3c commit 3066e05

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,9 +315,9 @@ public async Task ScheduleCommand(ScheduledCommand command)
315315
{
316316
await ScheduledCommands.InsertOneAsync(command);
317317
}
318-
catch (MongoBulkWriteException ex)
318+
catch (MongoWriteException ex)
319319
{
320-
if (ex.WriteErrors.All(x => x.Category == ServerErrorCategory.DuplicateKey))
320+
if (ex.WriteError?.Category == ServerErrorCategory.DuplicateKey)
321321
return;
322322
throw;
323323
}

0 commit comments

Comments
 (0)