[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
05/10: Use the status for ordering, as well as timestamp
From: |
Christopher Baines |
Subject: |
05/10: Use the status for ordering, as well as timestamp |
Date: |
Wed, 21 Oct 2020 15:50:31 -0400 (EDT) |
cbaines pushed a commit to branch master
in repository data-service.
commit fa6e4ac8427b4f1b36437214434d18462cbfca1d
Author: Christopher Baines <mail@cbaines.net>
AuthorDate: Wed Oct 21 19:47:11 2020 +0100
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).
---
guix-data-service/model/build.scm | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/guix-data-service/model/build.scm
b/guix-data-service/model/build.scm
index 8ec0af2..972a16a 100644
--- a/guix-data-service/model/build.scm
+++ b/guix-data-service/model/build.scm
@@ -253,7 +253,11 @@ SELECT build_servers.url,
'timestamp', build_status.timestamp,
'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
WHERE build_status.build_id = builds.id
@@ -295,7 +299,11 @@ SELECT build_servers.url,
'timestamp', build_status.timestamp,
'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
WHERE build_status.build_id = builds.id
- branch master updated (971a474 -> 63fc191), Christopher Baines, 2020/10/21
- 02/10: Cleanup scheduled and started builds with "0" timestamps, Christopher Baines, 2020/10/21
- 01/10: Fix broken links to builds, Christopher Baines, 2020/10/21
- 03/10: Add a view build link on the build page, Christopher Baines, 2020/10/21
- 04/10: Regenerate the latest_build_status table, Christopher Baines, 2020/10/21
- 05/10: Use the status for ordering, as well as timestamp,
Christopher Baines <=
- 07/10: Fix rendering of the /builds page, Christopher Baines, 2020/10/21
- 06/10: Limit the builds displayed on the /builds page, Christopher Baines, 2020/10/21
- 10/10: Sort the pending builds by timestamp, Christopher Baines, 2020/10/21
- 08/10: Increase the limit on pending builds to query, Christopher Baines, 2020/10/21
- 09/10: Update insert-new-latest-status-entries, Christopher Baines, 2020/10/21