|
@@ -10,12 +10,12 @@ import (
|
|
|
"net/http"
|
|
|
)
|
|
|
|
|
|
-// Confirm 返回 true(用来确认任务是否执行的,直接返回 true 即可)
|
|
|
+// 返回 true(用来确认任务是否执行的,直接返回 true 即可)
|
|
|
func Confirm(c *gin.Context) {
|
|
|
c.String(http.StatusOK, "true")
|
|
|
}
|
|
|
|
|
|
-// Tick 接收心跳,此处没有其他处理
|
|
|
+// 接收心跳,此处没有其他处理
|
|
|
func Tick(c *gin.Context) {
|
|
|
c.String(http.StatusOK, "true")
|
|
|
}
|
|
@@ -53,7 +53,9 @@ func State(c *gin.Context) {
|
|
|
for i, gpuNodeJson := range gpuNodeJsons {
|
|
|
node, _ := infra.JsonToGpuNode(gpuNodeJson)
|
|
|
if node.Hostname == nodeName {
|
|
|
- node.Parallelism++
|
|
|
+ newParallelism := node.Parallelism + 1
|
|
|
+ node.Parallelism = newParallelism
|
|
|
+ infra.GlobalLogger.Infof("归还1个并行度,剩余并行度为:【%v】", newParallelism)
|
|
|
nodeJson, _ := infra.GpuNodeToJson(node)
|
|
|
_, _ = infra.GlobalRedisClient.LSet(global.KeyGpuNodeList, int64(i), nodeJson).Result()
|
|
|
}
|