diff --git a/server/client.go b/server/client.go index d7588d06..d6f8c0a6 100644 --- a/server/client.go +++ b/server/client.go @@ -769,7 +769,7 @@ func (c *client) processSub(argo []byte) (err error) { c.traceInOp("SUB", argo) // Indicate activity. - c.cache.subs += 1 + c.cache.subs++ // Copy so we do not reference a potentially large buffer arg := make([]byte, len(argo)) diff --git a/server/monitor_test.go b/server/monitor_test.go index 7ca75015..75292dbe 100644 --- a/server/monitor_test.go +++ b/server/monitor_test.go @@ -371,10 +371,6 @@ func TestConnzLastActivity(t *testing.T) { defer nc.Close() nc.Flush() - nc2 := createClientConnSubscribeAndPublish(t, s) - defer nc2.Close() - nc2.Flush() - // Test inside details of each connection ci := pollConz(t, s, mode, url, opts).Conns[0] if len(ci.Subs) != 1 { @@ -429,8 +425,7 @@ func TestConnzLastActivity(t *testing.T) { time.Sleep(100 * time.Millisecond) // Message delivery should trigger as well - nc2.Publish("foo", []byte("Hello")) - nc2.Flush() + nc.Publish("foo", []byte("Hello")) nc.Flush() ci = pollConz(t, s, mode, url, opts).Conns[0] msgLast := ci.LastActivity