[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/10: Cleanup scheduled and started builds with "0" timestamps
From: |
Christopher Baines |
Subject: |
02/10: Cleanup scheduled and started builds with "0" timestamps |
Date: |
Wed, 21 Oct 2020 15:50:30 -0400 (EDT) |
cbaines pushed a commit to branch master
in repository data-service.
commit 41a7f38f44c10878e536135cbfabd4e37ca4fb21
Author: Christopher Baines <mail@cbaines.net>
AuthorDate: Wed Oct 21 19:25:30 2020 +0100
Cleanup scheduled and started builds with "0" timestamps
Not sure how these appeared, but deleting them seems to be sensible.
---
guix-data-service/builds.scm | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/guix-data-service/builds.scm b/guix-data-service/builds.scm
index e347789..7d681cc 100644
--- a/guix-data-service/builds.scm
+++ b/guix-data-service/builds.scm
@@ -123,12 +123,28 @@ initial connection on which HTTP requests are sent."
(_
(loop tail (+ 1 processed) result)))))))))) ;keep going
+(define (cleanup-bad-build-data conn)
+ (exec-query
+ conn
+ "
+DELETE FROM build_status
+WHERE status IN ('started', 'scheduled')
+ AND timestamp = '1970-01-01T00:00:00'
+ AND EXISTS (
+ SELECT 1
+ FROM build_status AS other
+ WHERE other.status = build_status.status
+ AND build_status.build_id = other.build_id
+ AND other.timestamp > '1970-01-01T00:00:01'
+ )"))
+
(define verbose-output?
(make-parameter #f))
(define* (query-build-servers conn build-server-ids revision-commits
outputs
#:key verbose?)
+ (cleanup-bad-build-data conn)
(parameterize
((verbose-output? verbose?))
(while #t
- branch master updated (971a474 -> 63fc191), Christopher Baines, 2020/10/21
- 02/10: Cleanup scheduled and started builds with "0" timestamps,
Christopher Baines <=
- 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, 2020/10/21
- 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