Skip to content

Commit 587c7b3

Browse files
committed
Speculative fix for futures error in SDK
1 parent 2d28ea4 commit 587c7b3

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

sdk/src/lib.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,15 @@ impl WorkflowHalf {
410410
Some(Variant::InitializeWorkflow(ref mut sw)) => Some(sw),
411411
_ => None,
412412
}) {
413+
if self.workflows.borrow().contains_key(&run_id) {
414+
// Duplicate init for the same run. Forward to existing workflow.
415+
if let Some(dat) = self.workflows.borrow_mut().get_mut(&run_id) {
416+
dat.activation_chan
417+
.send(activation)
418+
.expect("Workflow should exist if we're sending it an activation");
419+
}
420+
return Ok(None);
421+
}
413422
let workflow_type = &sw.workflow_type;
414423
let wf_fns_borrow = self.workflow_fns.borrow();
415424
let Some(wf_function) = wf_fns_borrow.get(workflow_type) else {

0 commit comments

Comments
 (0)