Manager: sort job types to ensure a consistent order

This commit is contained in:
Sybren A. Stüvel 2022-03-11 16:52:15 +01:00
parent 4f7c11d59a
commit 6d00d9cb34

View File

@ -7,6 +7,7 @@ package job_compilers
import (
"context"
"errors"
"sort"
"time"
"github.com/dop251/goja"
@ -193,6 +194,9 @@ func (s *Service) ListJobTypes() api.AvailableJobTypes {
jobTypes = append(jobTypes, jobType)
}
sort.Slice(jobTypes, func(i, j int) bool { return jobTypes[i].Name < jobTypes[j].Name })
return api.AvailableJobTypes{JobTypes: jobTypes}
}