Skip to content

Commit

Permalink
added locking to ClientURL()
Browse files Browse the repository at this point in the history
  • Loading branch information
adrian-thurston committed Sep 25, 2020
1 parent e331ec1 commit 85a8092
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions server/server.go
Expand Up @@ -1816,6 +1816,8 @@ func RunServerWithOpts(stanOpts *Options, natsOpts *server.Options) (newServer *

// ClientURL returns the basic URL string representation suitable for a client to use to connect
func (s *StanServer) ClientURL() string {
s.mu.Lock()
defer s.mu.Unlock()
if s.providedServerURL != "" {
return s.providedServerURL
} else if s.natsServer != nil {
Expand Down

0 comments on commit 85a8092

Please sign in to comment.