mirror of
https://github.com/ehang-io/nps.git
synced 2025-08-31 17:56:56 +00:00
Code optimization
This commit is contained in:
@@ -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
|
||||
|
@@ -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")
|
||||
}
|
||||
|
Reference in New Issue
Block a user