Skip to content

Commit 6cead5b

Browse files
committed
release in awaitCapabilites instead of callCapAsync
1 parent 8f688ad commit 6cead5b

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

pkg/workflows/wasm/host/execution.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ func (e *execution[T]) callCapAsync(ctx context.Context, req *sdkpb.CapabilityRe
5252
e.capabilityResponses[req.CallbackId] = ch
5353

5454
go func() {
55-
defer func() { <-e.pendingCallsSem }()
56-
5755
resp, err := e.executor.CallCapability(ctx, req)
5856

5957
if err != nil {
@@ -92,6 +90,7 @@ func (e *execution[T]) awaitCapabilities(ctx context.Context, acr *sdkpb.AwaitCa
9290
}
9391

9492
delete(e.capabilityResponses, callId)
93+
<-e.pendingCallsSem
9594
}
9695

9796
return &sdkpb.AwaitCapabilitiesResponse{

0 commit comments

Comments
 (0)