Code refactoring related to message handling and retry logic. (#3745)

This commit is contained in:
fatedier
2023-11-06 10:51:48 +08:00
committed by GitHub
parent 5760c1cf92
commit 184223cb2f
11 changed files with 701 additions and 540 deletions

View File

@ -144,7 +144,14 @@ func (svr *Service) apiStatus(w http.ResponseWriter, _ *http.Request) {
_, _ = w.Write(buf)
}()
ps := svr.ctl.pm.GetAllProxyStatus()
svr.ctlMu.RLock()
ctl := svr.ctl
svr.ctlMu.RUnlock()
if ctl == nil {
return
}
ps := ctl.pm.GetAllProxyStatus()
for _, status := range ps {
res[status.Type] = append(res[status.Type], NewProxyStatusResp(status, svr.cfg.ServerAddr))
}