diff options
-rw-r--r-- | guix-data-service/jobs.scm | 13 |
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" |