Manager: sort job types to ensure a consistent order
This commit is contained in:
parent
4f7c11d59a
commit
6d00d9cb34
@ -7,6 +7,7 @@ package job_compilers
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
|
"sort"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/dop251/goja"
|
"github.com/dop251/goja"
|
||||||
@ -193,6 +194,9 @@ func (s *Service) ListJobTypes() api.AvailableJobTypes {
|
|||||||
|
|
||||||
jobTypes = append(jobTypes, jobType)
|
jobTypes = append(jobTypes, jobType)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sort.Slice(jobTypes, func(i, j int) bool { return jobTypes[i].Name < jobTypes[j].Name })
|
||||||
|
|
||||||
return api.AvailableJobTypes{JobTypes: jobTypes}
|
return api.AvailableJobTypes{JobTypes: jobTypes}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user