Skip to content

Commit 2fd1407

Browse files
authored
Fix potential race with the sliding window sample. Fixes #279 (#280)
1 parent e2381f7 commit 2fd1407

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

batch_sliding_window/sliding_window_workflow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ async def _execute(self, input: SlidingWindowWorkflowInput) -> int:
108108

109109
# Start child workflow for this record
110110
child_id = f"{workflow_id}/{record.id}"
111+
self.current_records.add(record.id)
111112
child_handle = await workflow.start_child_workflow(
112113
RecordProcessorWorkflow.run,
113114
record,
@@ -117,7 +118,6 @@ async def _execute(self, input: SlidingWindowWorkflowInput) -> int:
117118
)
118119

119120
self.children_started_by_this_run.append(child_handle)
120-
self.current_records.add(record.id)
121121

122122
return await self._continue_as_new_or_complete(input)
123123

0 commit comments

Comments
 (0)