Skip to content

Commit

Permalink
commands/p2p: use cmds.EmitOnce in single value
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Overbool <overbool.xu@gmail.com>
  • Loading branch information
overbool committed Oct 30, 2018
1 parent 52154e9 commit 0df1e9c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/commands/p2p.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ var p2pLsCmd = &cmds.Command{
}
n.P2P.ListenersP2P.Unlock()

return res.Emit(output)
return cmds.EmitOnce(res, output)
},
Type: P2PLsOutput{},
Encoders: cmds.EncoderMap{
Expand Down Expand Up @@ -398,7 +398,7 @@ var p2pCloseCmd = &cmds.Command{
done := n.P2P.ListenersLocal.Close(match)
done += n.P2P.ListenersP2P.Close(match)

return res.Emit(done)
return cmds.EmitOnce(res, done)
},
Type: int(0),
Encoders: cmds.EncoderMap{
Expand Down Expand Up @@ -454,7 +454,7 @@ var p2pStreamLsCmd = &cmds.Command{
}
n.P2P.Streams.Unlock()

return res.Emit(output)
return cmds.EmitOnce(res, output)
},
Type: P2PStreamsOutput{},
Encoders: cmds.EncoderMap{
Expand Down

0 comments on commit 0df1e9c

Please sign in to comment.