|
@@ -77,6 +77,15 @@ func RunWaitingCluster() {
|
|
|
var firstTaskCache entity.TaskCache
|
|
|
if can {
|
|
|
infra.GlobalLogger.Infof("节点 %v 有剩余并行度。", gpuNode)
|
|
|
+ // 判断是否有待运行的任务
|
|
|
+ waitingClusterNumber, _ := infra.GlobalRedisClient.LLen(global.KeyTaskQueueWaitingCluster).Result()
|
|
|
+ if waitingClusterNumber == 0 {
|
|
|
+ infra.GlobalLogger.Info("集群没有等待运行的任务。")
|
|
|
+ continue
|
|
|
+ } else {
|
|
|
+ infra.GlobalLogger.Infof("集群存在 %v 个等待运行的任务。", waitingClusterNumber)
|
|
|
+ }
|
|
|
+
|
|
|
// 取出但不移除
|
|
|
firstTaskCacheJson, err := infra.GlobalRedisClient.LIndex(global.KeyTaskQueueWaitingCluster, 0).Result()
|
|
|
if err != nil {
|