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 863 B

12345678910111213141516171819202122232425262728293031
  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. // GetHpcTaskList get hpc task list
  7. func GetHpcTaskList(svc *svc.ServiceContext) ([]*types.TaskModel, error) {
  8. limit := 10
  9. offset := 0
  10. var list []*types.TaskModel
  11. db := svc.DbEngin.Model(&types.TaskModel{}).Table("task").
  12. Joins("join task_hpc hpc on task.id = hpc.task_id").
  13. Select("task.* ,hpc.job_id, hpc.work_dir, hpc.status, hpc.updated_time").
  14. Where("task.adapter_type_dict = 2 AND task.status NOT IN ('Succeeded', 'Failed') and task.deleted_at is null")
  15. //count total
  16. var total int64
  17. err := db.Count(&total).Error
  18. if err != nil {
  19. return nil, err
  20. }
  21. db.Limit(limit).Offset(offset)
  22. err = db.Order("created_time desc").Scan(&list).Error
  23. if err != nil {
  24. return nil, err
  25. }
  26. return list, nil
  27. }

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.