mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-17 03:24:40 -07:00
Add a comment to explain that we want to make a copy of the config
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
This commit is contained in:
@@ -1262,6 +1262,8 @@ func (s *Server) HandleRoot(w http.ResponseWriter, r *http.Request) {
|
||||
func (s *Server) updateJszVarz(js *jetStream, v *JetStreamVarz, doConfig bool) {
|
||||
if doConfig {
|
||||
js.mu.RLock()
|
||||
// We want to snapshot the config since it will then be available outside
|
||||
// of the js lock. So make a copy first, then point to this copy.
|
||||
cfg := js.config
|
||||
v.Config = &cfg
|
||||
js.mu.RUnlock()
|
||||
|
||||
Reference in New Issue
Block a user