1
0
mirror of https://github.com/newnius/YAO-scheduler.git synced 2025-12-18 09:06:44 +00:00
Files
YAO-scheduler/src/job_sorter.go

14 lines
230 B
Go
Raw Normal View History

2020-06-03 16:54:17 +08:00
package main
type JobSorter []Job
func (s JobSorter) Len() int {
return len(s)
}
func (s JobSorter) Swap(i, j int) {
s[i], s[j] = s[j], s[i]
}
func (s JobSorter) Less(i, j int) bool {
return s[i].CreatedAt < s[j].CreatedAt
}