store: make ListQueue return value more predictable by sorting it

The return value hasn't been predictable prior to this commit. This is
probably caused by internal implementation of Golang map. This commit
fixes it by sorting the output.
This commit is contained in:
Ondřej Budai 2019-11-28 08:31:06 +01:00 committed by Tom Gundersen
parent 7fbe8453ef
commit 268befa435

View file

@ -305,6 +305,11 @@ func (s *Store) ListQueue(uuids []uuid.UUID) []*ComposeEntry {
}
}
// make this function output more predictable
sort.Slice(composes, func(i, j int) bool {
return composes[i].ID.String() < composes[j].ID.String()
})
return composes
}