Commit 642cee13 authored by Daniel Hiltgen's avatar Daniel Hiltgen
Browse files

Sort the ps output

Provide consistent ordering for the ps command - longest duration listed first
parent 9929751c
......@@ -1224,6 +1224,11 @@ func (s *Server) ProcessHandler(c *gin.Context) {
models = append(models, mr)
}
slices.SortStableFunc(models, func(i, j api.ProcessModelResponse) int {
// longest duration remaining listed first
return cmp.Compare(j.ExpiresAt.Unix(), i.ExpiresAt.Unix())
})
c.JSON(http.StatusOK, api.ProcessResponse{Models: models})
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment