mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
Guard account client map
This commit is contained in:
@@ -1236,6 +1236,7 @@ func (s *Server) registerAccountNoLock(acc *Account) *Account {
|
||||
// Finish account setup and store.
|
||||
s.setAccountSublist(acc)
|
||||
|
||||
acc.mu.Lock()
|
||||
if acc.clients == nil {
|
||||
acc.clients = make(map[*client]struct{})
|
||||
}
|
||||
@@ -1245,7 +1246,6 @@ func (s *Server) registerAccountNoLock(acc *Account) *Account {
|
||||
// During config reload, it is possible that account was
|
||||
// already created (global account), so use locking and
|
||||
// make sure we create only if needed.
|
||||
acc.mu.Lock()
|
||||
// TODO(dlc)- Double check that we need this for GWs.
|
||||
if acc.rm == nil && s.opts != nil && s.shouldTrackSubscriptions() {
|
||||
acc.rm = make(map[string]int32)
|
||||
|
||||
Reference in New Issue
Block a user