mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-05-13 18:00:00 +08:00
should check if devServer Enabled, then call once.Do() (#4351)
Co-authored-by: william <myname@example.com>
This commit is contained in:
@@ -77,10 +77,11 @@ func (s *Server) StartAsync(c Config) {
|
|||||||
|
|
||||||
// StartAgent start inner http server by config.
|
// StartAgent start inner http server by config.
|
||||||
func StartAgent(c Config) {
|
func StartAgent(c Config) {
|
||||||
|
if !c.Enabled {
|
||||||
|
return
|
||||||
|
}
|
||||||
once.Do(func() {
|
once.Do(func() {
|
||||||
if c.Enabled {
|
s := NewServer(c)
|
||||||
s := NewServer(c)
|
s.StartAsync(c)
|
||||||
s.StartAsync(c)
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user