1
0
mirror of https://github.com/newnius/YAO-scheduler.git synced 2025-06-07 14:21:55 +00:00

update fair

This commit is contained in:
Newnius 2020-06-03 16:54:17 +08:00
parent b168389996
commit 6e9000a327

13
src/job_sorter.go Normal file
View File

@ -0,0 +1,13 @@
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
}