aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2023-11-05 20:01:37 +0000
committerChristopher Baines <mail@cbaines.net>2023-11-05 20:01:37 +0000
commit7891d1327b56f69822f7580f49c9945abf1a0f85 (patch)
tree54c1be502c867028ea56de3449cc5fa3790a2cf1
parent4f1ae74d2fb7feeaa43fecc773c417a16005d56b (diff)
downloaddata-service-7891d1327b56f69822f7580f49c9945abf1a0f85.tar
data-service-7891d1327b56f69822f7580f49c9945abf1a0f85.tar.gz
Add missing empty job log entry
-rw-r--r--guix-data-service/jobs.scm13
1 files changed, 13 insertions, 0 deletions
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"