updated deployinstancelistlogic

This commit is contained in:
tzwang 2024-08-30 15:30:02 +08:00
parent 319fb4908f
commit 4b21b863c4
1 changed files with 12 additions and 14 deletions

View File

@ -59,23 +59,21 @@ func (l *DeployInstanceListLogic) DeployInstanceList(req *types.DeployInstanceLi
} }
list := common.ConcatMultipleSlices(slices) list := common.ConcatMultipleSlices(slices)
if len(list) == 0 { if len(list) != 0 {
return go updater.UpdateDeployInstanceStatusBatch(l.svcCtx, list)
}
go updater.UpdateDeployInstanceStatusBatch(l.svcCtx, list) ins := list[0]
for i := range list {
ins := list[0] uTime, _ := time.Parse(time.RFC3339, ins.UpdateTime)
for i := range list { latest, _ := time.Parse(time.RFC3339, list[i].UpdateTime)
uTime, _ := time.Parse(time.RFC3339, ins.UpdateTime) if latest.After(uTime) {
latest, _ := time.Parse(time.RFC3339, list[i].UpdateTime) ins = list[i]
if latest.After(uTime) { }
ins = list[i]
} }
}
go updater.UpdateDeployInstanceStatus(l.svcCtx, ins, true) go updater.UpdateDeployInstanceStatus(l.svcCtx, ins, true)
go updater.UpdateDeployTaskStatus(l.svcCtx) go updater.UpdateDeployTaskStatus(l.svcCtx)
}
resp.List = &deployTasks resp.List = &deployTasks
resp.PageSize = req.PageSize resp.PageSize = req.PageSize