Persist workflow variables during background execution. (#6195)

Added a call to save workflow variables in the BackgroundActivityInvoker to ensure that any changes are persisted during background activity execution. This helps maintain consistency and state integrity across workflow invocations.
This commit is contained in:
Sipke Schoorstra 2024-12-09 20:36:20 +01:00 committed by GitHub
parent 4a19a77568
commit d1ee5c77d0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -41,6 +41,7 @@ public class BackgroundActivityInvoker(
activityExecutionContext.SetIsBackgroundExecution();
await activityInvoker.InvokeAsync(activityExecutionContext);
await ResumeWorkflowAsync(activityExecutionContext, scheduledBackgroundActivity);
await variablePersistenceManager.SaveVariablesAsync(workflowExecutionContext);
}
private async Task ResumeWorkflowAsync(ActivityExecutionContext activityExecutionContext, ScheduledBackgroundActivity scheduledBackgroundActivity)