fix: BlockStream rpc: only cancel response context at the end
This commit is contained in:
parent
8908da32be
commit
f07c1e6552
|
@ -572,7 +572,7 @@ func (rpcapi *IPFSConnectorRPCAPI) SwarmPeers(ctx context.Context, in struct{},
|
||||||
|
|
||||||
// BlockStream runs IPFSConnector.BlockStream().
|
// BlockStream runs IPFSConnector.BlockStream().
|
||||||
func (rpcapi *IPFSConnectorRPCAPI) BlockStream(ctx context.Context, in <-chan api.NodeWithMeta, out chan<- struct{}) error {
|
func (rpcapi *IPFSConnectorRPCAPI) BlockStream(ctx context.Context, in <-chan api.NodeWithMeta, out chan<- struct{}) error {
|
||||||
close(out)
|
defer close(out) // very important to do at the end
|
||||||
return rpcapi.ipfs.BlockStream(ctx, in)
|
return rpcapi.ipfs.BlockStream(ctx, in)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user