Skip to content

Commit

Permalink
Sort latest by version number. (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
robinjhuang authored Jan 7, 2025
1 parent 2c98ce9 commit 865dea9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions services/registry/registry_svc.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ func (s *RegistryService) ListNodes(ctx context.Context, client *ent.Client, pag
WithVersions(func(q *ent.NodeVersionQuery) {
q.Modify(func(s *sql.Selector) {
s.Where(sql.ExprP(
`(node_id, create_time) IN (
SELECT node_id, MAX(create_time)
`(node_id, version) IN (
SELECT node_id, MAX(version)
FROM node_versions
GROUP BY node_id
)`,
Expand Down Expand Up @@ -557,7 +557,7 @@ func (s *RegistryService) GetLatestNodeVersion(ctx context.Context, client *ent.
schema.NodeVersionStatusFlagged,
schema.NodeVersionStatusPending,
)).
Order(ent.Desc(nodeversion.FieldCreateTime)).
Order(ent.Desc(nodeversion.FieldVersion)).
WithStorageFile().
WithComfyNodes().
First(ctx)
Expand Down

0 comments on commit 865dea9

Please sign in to comment.