Skip to content

Commit

Permalink
Honor comment of non-nil rpcRes even if context closed
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Broadhurst <[email protected]>
  • Loading branch information
peterbroadhurst committed Sep 28, 2023
1 parent 038e29f commit e374a76
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/rpcbackend/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ func (rc *RPCClient) SyncRequest(ctx context.Context, rpcReq *RPCRequest) (rpcRe
case rc.concurrencySlots <- true:
// wait for the concurrency slot and continue
case <-ctx.Done():
return nil, i18n.NewError(ctx, signermsgs.MsgRequestCanceledContext, rpcReq.ID)
err := i18n.NewError(ctx, signermsgs.MsgRequestCanceledContext, rpcReq.ID)
return RPCErrorResponse(err, rpcReq.ID, RPCCodeInternalError), err
}
defer func() {
<-rc.concurrencySlots
Expand Down

0 comments on commit e374a76

Please sign in to comment.