Skip to content

Commit

Permalink
fix: heap comparator for lines incorrectly handles state
Browse files Browse the repository at this point in the history
  • Loading branch information
starpit committed Apr 7, 2023
1 parent d902c32 commit 1b448e1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default class Live {
return a.timestamp - b.timestamp
}

const stateDiff = b.stateRank - a.stateRank
const stateDiff = a.stateRank - b.stateRank
if (stateDiff !== 0) {
return stateDiff
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ export type WorkerState = (typeof states)[number]
/** Lower means more important */
export const rankFor: Record<WorkerState, number> = {
Queued: 3,
Provisioning: 1,
Initializing: 2,
Provisioning: 2,
Initializing: 4,
Running: 1,
Success: 0,
Failed: 0,
Expand Down

0 comments on commit 1b448e1

Please sign in to comment.