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

23 lines
352 B

package node
import (
"sunteng/cronsun/models"
)
type Job map[string]*models.Job
func newJob(id string, g Group) (j Job, err error) {
jobs, err := models.GetJobs()
if err != nil {
return
}
j = make(Job, len(jobs))
for _, job := range jobs {
if sch, _ := job.Schedule(id, g, false); len(sch) > 0 {
j[job.GetID()] = job
}
}
return
}