You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

hpc_cron_task.go 827 B

123456789101112131415161718192021222324252627282930
  1. package cron
  2. import (
  3. "gitlink.org.cn/JointCloud/pcm-coordinator/internal/svc"
  4. "gitlink.org.cn/JointCloud/pcm-coordinator/internal/types"
  5. )
  6. func GetHpcTaskList(svc *svc.ServiceContext) ([]*types.TaskModel, error) {
  7. limit := 10
  8. offset := 0
  9. var list []*types.TaskModel
  10. db := svc.DbEngin.Model(&types.TaskModel{}).Table("task").
  11. Joins("join task_hpc hpc on task.id = hpc.task_id").
  12. Select("task.* ,hpc.job_id, hpc.work_dir, hpc.status, hpc.updated_time").
  13. Where("task.adapter_type_dict = 2 AND task.status NOT IN ('Succeeded', 'Failed') and task.deleted_at is null")
  14. //count total
  15. var total int64
  16. err := db.Count(&total).Error
  17. if err != nil {
  18. return nil, err
  19. }
  20. db.Limit(limit).Offset(offset)
  21. err = db.Order("created_time desc").Scan(&list).Error
  22. if err != nil {
  23. return nil, err
  24. }
  25. return list, nil
  26. }

PCM is positioned as Software stack over Cloud, aiming to build the standards and ecology of heterogeneous cloud collaboration for JCC in a non intrusive and autonomous peer-to-peer manner.