diff --git a/api/desc/pcm.api b/api/desc/pcm.api index 2cb1e06c..f7290a96 100644 --- a/api/desc/pcm.api +++ b/api/desc/pcm.api @@ -978,6 +978,9 @@ service pcm { @handler GetComputeCardsByClusterHandler get /schedule/getComputeCardsByCluster/:adapterId/:clusterId (GetComputeCardsByClusterReq) returns (GetComputeCardsByClusterResp) + + @handler GetClusterBalanceByIdHandler + get /schedule/getClusterBalanceById/:adapterId/:clusterId (GetClusterBalanceByIdReq) returns (GetClusterBalanceByIdResp) } @server( diff --git a/api/desc/schedule/pcm-schedule.api b/api/desc/schedule/pcm-schedule.api index 9be2c829..e612f9fb 100644 --- a/api/desc/schedule/pcm-schedule.api +++ b/api/desc/schedule/pcm-schedule.api @@ -141,4 +141,13 @@ type ( GetComputeCardsByClusterResp { Cards []string `json:"cards"` } + + GetClusterBalanceByIdReq{ + AdapterId string `path:"adapterId"` + ClusterId string `path:"clusterId"` + } + + GetClusterBalanceByIdResp{ + Balance float64 `json:"balance"` + } ) \ No newline at end of file diff --git a/api/internal/logic/core/pagelisttasklogic.go b/api/internal/logic/core/pagelisttasklogic.go index 32cc2240..f1858a4a 100644 --- a/api/internal/logic/core/pagelisttasklogic.go +++ b/api/internal/logic/core/pagelisttasklogic.go @@ -143,6 +143,11 @@ func (l *PageListTaskLogic) updateTaskStatus(tasks []*types.TaskModel, ch chan<- } } + if len(aiTask) == 0 { + ch <- struct{}{} + return + } + start, _ := time.ParseInLocation(constants.Layout, aiTask[0].StartTime, time.Local) end, _ := time.ParseInLocation(constants.Layout, aiTask[0].EndTime, time.Local)