Use the status for ordering, as well as timestamp
As this will handle cases where the timestamps from Cuirass don't make sense, like a build being canceled with a timestamp of 0 (1970).
This commit is contained in:
parent
6a04d474c0
commit
fa6e4ac842
1 changed files with 10 additions and 2 deletions
|
|
@ -253,7 +253,11 @@ SELECT build_servers.url,
|
||||||
'timestamp', build_status.timestamp,
|
'timestamp', build_status.timestamp,
|
||||||
'status', build_status.status
|
'status', build_status.status
|
||||||
)
|
)
|
||||||
ORDER BY build_status.timestamp
|
ORDER BY CASE WHEN status = 'scheduled' THEN -2
|
||||||
|
WHEN status = 'started' THEN -1
|
||||||
|
ELSE 0
|
||||||
|
END ASC,
|
||||||
|
timestamp ASC
|
||||||
)
|
)
|
||||||
FROM build_status
|
FROM build_status
|
||||||
WHERE build_status.build_id = builds.id
|
WHERE build_status.build_id = builds.id
|
||||||
|
|
@ -295,7 +299,11 @@ SELECT build_servers.url,
|
||||||
'timestamp', build_status.timestamp,
|
'timestamp', build_status.timestamp,
|
||||||
'status', build_status.status
|
'status', build_status.status
|
||||||
)
|
)
|
||||||
ORDER BY build_status.timestamp
|
ORDER BY CASE WHEN status = 'scheduled' THEN -2
|
||||||
|
WHEN status = 'started' THEN -1
|
||||||
|
ELSE 0
|
||||||
|
END ASC,
|
||||||
|
timestamp ASC
|
||||||
)
|
)
|
||||||
FROM build_status
|
FROM build_status
|
||||||
WHERE build_status.build_id = builds.id
|
WHERE build_status.build_id = builds.id
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue