[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
06/07: Add missing empty job log entry
From: |
Christopher Baines |
Subject: |
06/07: Add missing empty job log entry |
Date: |
Thu, 9 Nov 2023 11:45:02 -0500 (EST) |
cbaines pushed a commit to branch master
in repository data-service.
commit 7891d1327b56f69822f7580f49c9945abf1a0f85
Author: Christopher Baines <mail@cbaines.net>
AuthorDate: Sun Nov 5 20:01:37 2023 +0000
Add missing empty job log entry
---
guix-data-service/jobs.scm | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/guix-data-service/jobs.scm b/guix-data-service/jobs.scm
index f848f2e..e2294e9 100644
--- a/guix-data-service/jobs.scm
+++ b/guix-data-service/jobs.scm
@@ -36,6 +36,17 @@
(define (log-part-sequence-name job-id)
(simple-format #f "load_new_guix_revision_job_log_parts_id_seq_~A" job-id))
+(define (insert-empty-log-entry conn job-id)
+ (exec-query
+ conn
+ "DELETE FROM load_new_guix_revision_job_logs WHERE job_id = $1"
+ (list job-id))
+ (exec-query
+ conn
+ "INSERT INTO load_new_guix_revision_job_logs (job_id, contents) VALUES
+($1, NULL)"
+ (list job-id)))
+
(define (start-thread-for-process-output job-id)
(define (insert conn job_id s)
(exec-query
@@ -71,6 +82,8 @@ VALUES (nextval('" (log-part-sequence-name job_id) "'), $1,
$2)")
"DELETE FROM load_new_guix_revision_job_log_parts WHERE job_id =
$1"
(list job-id))
+ (insert-empty-log-entry logging-conn job-id)
+
(let loop ((line (get-line port-to-read-from)))
(if (eof-object? line)
(simple-format #t "finished reading logs for ~A\n"
- branch master updated (2135bc5 -> 37a07c2), Christopher Baines, 2023/11/09
- 05/07: Handle derivations with no sources, Christopher Baines, 2023/11/09
- 02/07: Restore #:error-port when calling open-inferior, Christopher Baines, 2023/11/09
- 01/07: Remove #:use-module (ice-9 custom-ports), Christopher Baines, 2023/11/09
- 07/07: Try to avoid the metrics timing out, Christopher Baines, 2023/11/09
- 06/07: Add missing empty job log entry,
Christopher Baines <=
- 04/07: Handle eof when reading logs, Christopher Baines, 2023/11/09
- 03/07: Remove peek, Christopher Baines, 2023/11/09