Fix: stop listening HTTP port if unix socket is enabled (#729)

This commit is contained in:
HFO4 2021-03-17 14:19:05 +08:00
parent 270f617b9d
commit 40476953aa
2 changed files with 6 additions and 7 deletions

2
assets

@ -1 +1 @@
Subproject commit 8a3553aec3c6c285e71d31d6d1e08febf994feb6 Subproject commit 21c3082ba8d52a8b88cd8468c94e29edbbb1f017

11
main.go
View file

@ -51,12 +51,11 @@ func main() {
// 如果启用了Unix // 如果启用了Unix
if conf.UnixConfig.Listen != "" { if conf.UnixConfig.Listen != "" {
go func() { util.Log().Info("开始监听 %s", conf.UnixConfig.Listen)
util.Log().Info("开始监听 %s", conf.UnixConfig.Listen) if err := api.RunUnix(conf.UnixConfig.Listen); err != nil {
if err := api.RunUnix(conf.UnixConfig.Listen); err != nil { util.Log().Error("无法监听[%s]%s", conf.UnixConfig.Listen, err)
util.Log().Error("无法监听[%s]%s", conf.UnixConfig.Listen, err) }
} return
}()
} }
util.Log().Info("开始监听 %s", conf.SystemConfig.Listen) util.Log().Info("开始监听 %s", conf.SystemConfig.Listen)