mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
Only increment server stats if available
This commit is contained in:
@@ -417,8 +417,10 @@ func (c *client) processMsg(msg []byte) {
|
||||
c.inMsgs++
|
||||
c.inBytes += int64(len(msg))
|
||||
|
||||
atomic.AddInt64(&c.srv.inMsgs, 1)
|
||||
atomic.AddInt64(&c.srv.inBytes, int64(len(msg)))
|
||||
if c.srv != nil {
|
||||
atomic.AddInt64(&c.srv.inMsgs, 1)
|
||||
atomic.AddInt64(&c.srv.inBytes, int64(len(msg)))
|
||||
}
|
||||
|
||||
if trace {
|
||||
c.traceMsg(msg)
|
||||
|
||||
Reference in New Issue
Block a user