Merge branch 'main' into dev

This commit is contained in:
Derek Collison
2023-04-17 08:43:08 -07:00
7 changed files with 41 additions and 27 deletions

View File

@@ -1741,13 +1741,23 @@ func (s *Server) fetchAccount(name string) (*Account, error) {
}
// The sub imports may have been setup but will not have had their
// subscriptions properly setup. Do that here.
var needImportSubs bool
acc.mu.Lock()
if len(acc.imports.services) > 0 {
if acc.ic == nil {
acc.ic = s.createInternalAccountClient()
acc.ic.acc = acc
}
needImportSubs = true
}
acc.mu.Unlock()
// Do these outside the lock.
if needImportSubs {
acc.addAllServiceImportSubs()
}
return acc, nil
}