some improvements

This commit is contained in:
fatedier
2022-04-14 11:24:36 +08:00
parent 6481870d03
commit 21240ed962
3 changed files with 9 additions and 3 deletions

View File

@@ -357,8 +357,13 @@ func (svr *Service) ReloadConf(pxyCfgs map[string]config.ProxyConf, visitorCfgs
svr.cfgMu.Unlock()
svr.ctlMu.RLock()
defer svr.ctlMu.RUnlock()
return svr.ctl.ReloadConf(pxyCfgs, visitorCfgs)
ctl := svr.ctl
svr.ctlMu.RUnlock()
if ctl != nil {
return svr.ctl.ReloadConf(pxyCfgs, visitorCfgs)
}
return nil
}
func (svr *Service) Close() {