Skip to content

Commit

Permalink
should check if devServer Enabled, then call once.Do() (#4351)
Browse files Browse the repository at this point in the history
Co-authored-by: william <myname@example.com>
  • Loading branch information
jursonmo and william authored Sep 3, 2024
1 parent 90afa08 commit 0cafb11
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions internal/devserver/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,11 @@ func (s *Server) StartAsync(c Config) {

// StartAgent start inner http server by config.
func StartAgent(c Config) {
if !c.Enabled {
return
}
once.Do(func() {
if c.Enabled {
s := NewServer(c)
s.StartAsync(c)
}
s := NewServer(c)
s.StartAsync(c)
})
}

0 comments on commit 0cafb11

Please sign in to comment.