901
902
// now we know it's not running, remove from running workflow list
903
>
matchRunning := func(ex *commonpb.WorkflowExecution) bool { return ex.GetWorkflowId() == id }
workflow.go
904
>
if idx := slices.IndexFunc(s.Info.RunningWorkflows, matchRunning); idx >= 0 {
905
>
// We could also immediately update visibility, with updateMemoAndSearchAttributes,
906
>
// but the wakeup here will trigger a write after anyways (after processing the buffer).
907
>
s.Info.RunningWorkflows = slices.Delete(s.Info.RunningWorkflows, idx, idx+1)
908
>
} else {
909
// This could happen if the watcher activity gets interrupted and is retried after the
910
// heartbeat timeout, but in the meantime we have done a refresh through a local activity.