实现健康检查配置、立即执行健康检查

This commit is contained in:
GoEdgeLab
2020-10-17 21:15:31 +08:00
parent 1938f2dd0f
commit bf69a60913
10 changed files with 341 additions and 11 deletions

View File

@@ -0,0 +1,19 @@
package tasks
import (
"github.com/iwind/TeaGo/dbs"
"testing"
)
func TestHealthCheckExecutor_Run(t *testing.T) {
dbs.NotifyReady()
executor := NewHealthCheckExecutor(10)
results, err := executor.Run()
if err != nil {
t.Fatal(err)
}
for _, result := range results {
t.Log(result.Node.Name, "addr:", result.NodeAddr, "isOk:", result.IsOk, "error:", result.Error)
}
}