mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-13 15:30:24 +08:00
实现健康检查配置、立即执行健康检查
This commit is contained in:
19
internal/tasks/health_check_executor_test.go
Normal file
19
internal/tasks/health_check_executor_test.go
Normal 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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user