mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
@@ -84,10 +84,10 @@ type DisconnectEventMsg struct {
|
||||
Reason string `json:"reason"`
|
||||
}
|
||||
|
||||
// accNumConns is an event that will be sent from a server that is tracking
|
||||
// AccountNumConns is an event that will be sent from a server that is tracking
|
||||
// a given account when the number of connections changes. It will also HB
|
||||
// updates in the absence of any changes.
|
||||
type accNumConns struct {
|
||||
type AccountNumConns struct {
|
||||
Server ServerInfo `json:"server"`
|
||||
Account string `json:"acc"`
|
||||
Conns int `json:"conns"`
|
||||
@@ -609,7 +609,7 @@ func (s *Server) remoteConnsUpdate(sub *subscription, subject, reply string, msg
|
||||
if !s.eventsEnabled() {
|
||||
return
|
||||
}
|
||||
m := accNumConns{}
|
||||
m := AccountNumConns{}
|
||||
if err := json.Unmarshal(msg, &m); err != nil {
|
||||
s.sys.client.Errorf("Error unmarshalling account connection event message: %v", err)
|
||||
return
|
||||
@@ -676,7 +676,7 @@ func (s *Server) sendAccConnsUpdate(a *Account, subj string) {
|
||||
}
|
||||
|
||||
// Build event with account name and number of local clients.
|
||||
m := accNumConns{
|
||||
m := AccountNumConns{
|
||||
Account: a.Name,
|
||||
Conns: a.numLocalConnections(),
|
||||
}
|
||||
|
||||
@@ -509,7 +509,7 @@ func TestSystemAccountConnectionUpdatesStopAfterNoLocal(t *testing.T) {
|
||||
}
|
||||
// Check last one.
|
||||
msg := <-received
|
||||
m := accNumConns{}
|
||||
m := AccountNumConns{}
|
||||
if err := json.Unmarshal(msg.Data, &m); err != nil {
|
||||
t.Fatalf("Error unmarshalling account connections request message: %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user