mirror of
https://github.com/newnius/YAO-scheduler.git
synced 2025-06-07 06:11:56 +00:00
update fair
This commit is contained in:
parent
b168389996
commit
6e9000a327
13
src/job_sorter.go
Normal file
13
src/job_sorter.go
Normal 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
|
||||
}
|
Loading…
Reference in New Issue
Block a user