pcm-core任务查询条件修改

This commit is contained in:
zhangwei 2023-04-27 15:01:35 +08:00
parent 9a83185142
commit 7c1d1372e6
1 changed files with 1 additions and 1 deletions

View File

@ -12,7 +12,7 @@ func InitCron(svc *svc.ServiceContext) {
svc.Cron.Start()
svc.Cron.AddFunc("*/5 * * * * ?", func() {
var tasks []model.Task
svc.DbEngin.Find(&tasks)
svc.DbEngin.Not("status = ?", "Completed").Find(&tasks)
for _, task := range tasks {
var allStatus string
tx := svc.DbEngin.Raw("SELECT CONCAT_WS(',',GROUP_CONCAT(DISTINCT h.status) ,GROUP_CONCAT(DISTINCT a.status) ,GROUP_CONCAT(DISTINCT c.status))as status from task t left join hpc h on t.id = h.task_id left join cloud c on t.id = c.task_id left join ai a on t.id = a.task_id where t.id = ?", task.Id).Scan(&allStatus)