mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-02-02 16:28:39 +08:00
should check if devServer Enabled, then call once.Do() (#4351)
Co-authored-by: william <myname@example.com>
This commit is contained in:
parent
90afa08367
commit
0cafb1164b
@ -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)
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user