Code optimization

This commit is contained in:
刘河
2019-03-29 10:41:57 +08:00
parent 4b0aebd6a5
commit cc6d053b6d
32 changed files with 357 additions and 289 deletions

View File

@@ -163,7 +163,7 @@ re:
}
c.Close()
logs.Notice("Temporary access login key ", vkey)
logs.Notice("web access login key ", vkey)
NewRPClient(cnf.CommonConfig.Server, vkey, cnf.CommonConfig.Tp, cnf.CommonConfig.ProxyUrl, cnf).Start()
CloseLocalServer()
goto re

View File

@@ -63,7 +63,7 @@ func session(healths []*file.Health, h *sheap.IntHeap) {
}
}
//只针对一个端口 面向多个目标的情况
// work when just one port and many target
func check(t *file.Health) {
arr := strings.Split(t.HealthCheckTarget, ",")
var err error
@@ -88,7 +88,7 @@ func check(t *file.Health) {
t.HealthMap[v] = 0
}
if t.HealthMap[v] == t.HealthMaxFail {
if t.HealthMap[v] > 0 && t.HealthMap[v]%t.HealthMaxFail == 0 {
//send fail remove
serverConn.SendHealthInfo(v, "0")
}