Commit 140a3dc1 authored by 吴贤德's avatar 吴贤德

中心服务:修复不自动更新站点配置问题

parent b059c973
......@@ -39,7 +39,7 @@ func Post(url string, jsonBody string) (string, error) {
func Get(url string) (string, error) {
//log.Infoln("request : ",url)
//req.Debug = false
//req.Debug = true
req.SetFlags(req.LstdFlags | req.Lcost)
req.SetTimeout(time.Duration(60) * time.Second)
......
......@@ -12,6 +12,7 @@ type ConfigChecker struct {
func (this *ConfigChecker) Start() {
this.startSysConfigChecker()
this.startSpsConfigChecker()
this.startSitesConfigChecker()
}
func (this *ConfigChecker) startSysConfigChecker() {
......@@ -41,3 +42,17 @@ func (this *ConfigChecker) startSpsConfigChecker() {
goto START
}()
}
func (this *ConfigChecker) startSitesConfigChecker() {
config := Config.GetInstance()
go func() {
START:
s, ok := config.Sys.Get("config_sp_check_seconds")
if ok {
n := Unit.Time2Seconds(s.(string))
time.Sleep(time.Duration(n) * time.Second)
config.InitSitesConfig()
}
goto START
}()
}
\ No newline at end of file
[local]
api_conf_sys = http://192.168.199.104:801/api/center/conf_sys
api_conf_sps = http://192.168.199.104:801/api/center/conf_sps
api_conf_sites = http://192.168.199.104:801/api/center/conf_sites
api_tb_playlog_create = http://192.168.199.104:801/api/center/tb_playlog_create
log_path = ./
log_filename = center_service.log
[debug]
api_conf_sys = http://192.168.200.134:801/api/center/conf_sys
api_conf_sps = http://192.168.200.134:801/api/center/conf_sps
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment