Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ollama
Commits
642cee13
Commit
642cee13
authored
Jun 21, 2024
by
Daniel Hiltgen
Browse files
Sort the ps output
Provide consistent ordering for the ps command - longest duration listed first
parent
9929751c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
server/routes.go
server/routes.go
+5
-0
No files found.
server/routes.go
View file @
642cee13
...
@@ -1224,6 +1224,11 @@ func (s *Server) ProcessHandler(c *gin.Context) {
...
@@ -1224,6 +1224,11 @@ func (s *Server) ProcessHandler(c *gin.Context) {
models
=
append
(
models
,
mr
)
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
})
c
.
JSON
(
http
.
StatusOK
,
api
.
ProcessResponse
{
Models
:
models
})
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment