Skip to content

Commit

Permalink
added more debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
jubeless committed Nov 18, 2020
1 parent 6ca7856 commit 5a21265
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions rpc/ws/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,14 @@ func (c *Client) handleMessage(message []byte) {
func (c *Client) handleNewSubscriptionMessage(requestID, subID uint64) {
c.lock.Lock()
defer c.lock.Unlock()

if traceEnabled {
zlog.Debug("received new subscription message",
zap.Uint64("message_id", requestID),
zap.Uint64("subscription_id", subID),
)
}

callBack, found := c.subscriptionByRequestID[requestID]
if !found {
zlog.Error("cannot find websocket message handler for a new stream.... this should not happen",
Expand All @@ -105,6 +107,12 @@ func (c *Client) handleNewSubscriptionMessage(requestID, subID uint64) {
}
callBack.subID = subID
c.subscriptionByWSSubID[subID] = callBack

zlog.Debug("registered ws subscription",
zap.Uint64("subscription_id", subID),
zap.Uint64("request_id", requestID),
zap.Int("subscription_count", len(c.subscriptionByWSSubID)),
)
return
}

Expand Down

0 comments on commit 5a21265

Please sign in to comment.