mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2026-01-03 17:46:36 +08:00
服务配置校验错误后仍然继续解析,不再停止运行
This commit is contained in:
@@ -30,6 +30,8 @@ type ServerConfig struct {
|
||||
// 反向代理配置
|
||||
ReverseProxyRef *ReverseProxyRef `yaml:"reverseProxyRef" json:"reverseProxyRef"`
|
||||
ReverseProxy *ReverseProxyConfig `yaml:"reverseProxy" json:"reverseProxy"`
|
||||
|
||||
isOk bool
|
||||
}
|
||||
|
||||
// 从JSON中解析Server配置
|
||||
@@ -107,9 +109,16 @@ func (this *ServerConfig) Init() error {
|
||||
}
|
||||
}
|
||||
|
||||
this.isOk = true
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// 配置是否正确
|
||||
func (this *ServerConfig) IsOk() bool {
|
||||
return this.isOk
|
||||
}
|
||||
|
||||
func (this *ServerConfig) FullAddresses() []string {
|
||||
result := []string{}
|
||||
if this.HTTP != nil && this.HTTP.IsOn {
|
||||
|
||||
Reference in New Issue
Block a user