File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed
providers/WorkflowCore.Persistence.EntityFramework/Services Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -67,8 +67,14 @@ private void RunWorkflows()
67
67
workflow = _persistenceStore . GetWorkflowInstance ( workflowId ) . Result ;
68
68
if ( workflow . Status == WorkflowStatus . Runnable )
69
69
{
70
- result = _executor . Execute ( workflow , _options ) ;
71
- _persistenceStore . PersistWorkflow ( workflow ) . Wait ( ) ;
70
+ try
71
+ {
72
+ result = _executor . Execute ( workflow , _options ) ;
73
+ }
74
+ finally
75
+ {
76
+ _persistenceStore . PersistWorkflow ( workflow ) . Wait ( ) ;
77
+ }
72
78
}
73
79
}
74
80
finally
Original file line number Diff line number Diff line change @@ -330,11 +330,14 @@ public async Task MarkEventUnprocessed(string id)
330
330
331
331
public async Task PersistErrors ( IEnumerable < ExecutionError > errors )
332
332
{
333
- foreach ( var error in errors )
333
+ lock ( this )
334
334
{
335
- Set < PersistedExecutionError > ( ) . Add ( error . ToPersistable ( ) ) ;
335
+ foreach ( var error in errors )
336
+ {
337
+ Set < PersistedExecutionError > ( ) . Add ( error . ToPersistable ( ) ) ;
338
+ }
339
+ SaveChanges ( ) ;
336
340
}
337
- await SaveChangesAsync ( ) ;
338
341
}
339
342
}
340
343
#pragma warning restore CS1998 // Async method lacks 'await' operators and will run synchronously
You can’t perform that action at this time.
0 commit comments