Skip to content

Commit

Permalink
fix cluster task sorting order
Browse files Browse the repository at this point in the history
  • Loading branch information
LexLuthr committed Oct 9, 2024
1 parent 11ca825 commit aef5dba
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion web/api/webrpc/pipeline_porep.go
Original file line number Diff line number Diff line change
Expand Up @@ -412,5 +412,5 @@ func (a *WebRPC) getOwner(ctx context.Context, id int64) (bool, error) {
if err != nil {
return false, xerrors.Errorf("failed to fetch owner ID: %w", err)
}
return &owner != nil, nil
return owner > 0, nil
}
3 changes: 2 additions & 1 deletion web/api/webrpc/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ func (a *WebRPC) ClusterTaskSummary(ctx context.Context) ([]TaskSummary, error)
err := a.deps.DB.Select(ctx, &ts, `SELECT
t.id as id, t.name as name, t.update_time as since_posted, t.owner_id as owner_id, hm.host_and_port as owner
FROM harmony_task t LEFT JOIN harmony_machines hm ON hm.id = t.owner_id
ORDER BY t.update_time ASC, t.owner_id`)
ORDER BY
CASE WHEN t.owner_id IS NULL THEN 1 ELSE 0 END, t.update_time ASC`)
if err != nil {
return nil, err // Handle error
}
Expand Down
2 changes: 1 addition & 1 deletion web/static/pages/pipeline_porep/pipeline-porep-sectors.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ customElements.define('pipeline-porep-sectors',class PipelinePorepSectors extend
}
.pipeline-waiting {
background-color: #d0d0d0;
background-color: #808080;
}`
properties = {
sector: Object,
Expand Down

0 comments on commit aef5dba

Please sign in to comment.