mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-05 01:20:25 +08:00
在缓存任务键值中增加集群信息,以便于调试问题
This commit is contained in:
@@ -353,6 +353,19 @@ func (this *HTTPCacheTaskService) FindEnabledHTTPCacheTask(ctx context.Context,
|
|||||||
key.Errors = nil
|
key.Errors = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 集群信息
|
||||||
|
var pbNodeCluster *pb.NodeCluster
|
||||||
|
if !isFromUser && key.ClusterId > 0 {
|
||||||
|
clusterName, findClusterErr := models.SharedNodeClusterDAO.FindNodeClusterName(tx, int64(key.ClusterId))
|
||||||
|
if findClusterErr != nil {
|
||||||
|
return nil, findClusterErr
|
||||||
|
}
|
||||||
|
pbNodeCluster = &pb.NodeCluster{
|
||||||
|
Id: int64(key.ClusterId),
|
||||||
|
Name: clusterName,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pbKeys = append(pbKeys, &pb.HTTPCacheTaskKey{
|
pbKeys = append(pbKeys, &pb.HTTPCacheTaskKey{
|
||||||
Id: int64(key.Id),
|
Id: int64(key.Id),
|
||||||
TaskId: int64(key.TaskId),
|
TaskId: int64(key.TaskId),
|
||||||
@@ -361,6 +374,7 @@ func (this *HTTPCacheTaskService) FindEnabledHTTPCacheTask(ctx context.Context,
|
|||||||
IsDone: key.IsDone,
|
IsDone: key.IsDone,
|
||||||
IsDoing: !key.IsDone && len(key.DecodeNodes()) > 0,
|
IsDoing: !key.IsDone && len(key.DecodeNodes()) > 0,
|
||||||
ErrorsJSON: key.Errors,
|
ErrorsJSON: key.Errors,
|
||||||
|
NodeCluster: pbNodeCluster,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user