diff --git a/internal/devserver/server.go b/internal/devserver/server.go index e65722716c09..069612b1f358 100644 --- a/internal/devserver/server.go +++ b/internal/devserver/server.go @@ -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) }) }