mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
Make sure connection events during auth callouts correct.
Fixed one extraneous account update for $G. We sent for the addition before switching but suppressed the change back to 0. We now suppress all for $G as was designed. Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
@@ -1919,10 +1919,11 @@ func (a *Account) statz() *AccountStat {
|
||||
|
||||
// accConnsUpdate is called whenever there is a change to the account's
|
||||
// number of active connections, or during a heartbeat.
|
||||
// We will not send for $G.
|
||||
func (s *Server) accConnsUpdate(a *Account) {
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
if !s.eventsEnabled() || a == nil {
|
||||
if !s.eventsEnabled() || a == nil || a == s.gacc {
|
||||
return
|
||||
}
|
||||
s.sendAccConnsUpdate(a, fmt.Sprintf(accConnsEventSubjOld, a.Name), fmt.Sprintf(accConnsEventSubjNew, a.Name))
|
||||
|
||||
Reference in New Issue
Block a user