实现获取设备地址和负载均衡

remotes/1718373473996375672/master
zimujun20 2 years ago
parent 38f3778b7a
commit 06d088e333

@ -6,6 +6,7 @@ import (
"time"
"math/rand"
"strings"
"pkg/app"
)
//拉取在线的算力设备
@ -53,10 +54,11 @@ func shuffle(n []string) {
}
//返回可进行运算的设备地址
func request() []string {
func request(c *gin.Contex) []string {
appG := app.Gin{C: c}
var ipAddress = ipAddress()
for i := 0; i < 3; i++ {
shuffle(ipAddress)
}
return ipAddress
appG.Response(http.StatusOK, "成功", null)
}
Loading…
Cancel
Save