Guard against errors when recording job stderr output
This might help at least handle errors when inserting data in to PostgreSQL.
This commit is contained in:
parent
2c463fcdab
commit
da8586f62d
1 changed files with 26 additions and 3 deletions
|
|
@ -173,9 +173,32 @@ VALUES (nextval('" (log-part-sequence-name job_id) "'), $1, $2)")
|
||||||
(let loop ((line (get-line port-to-read-from)))
|
(let loop ((line (get-line port-to-read-from)))
|
||||||
(let ((line-with-newline
|
(let ((line-with-newline
|
||||||
(string-append line "\n")))
|
(string-append line "\n")))
|
||||||
|
(catch #t
|
||||||
|
(lambda ()
|
||||||
(insert logging-conn job-id line-with-newline)
|
(insert logging-conn job-id line-with-newline)
|
||||||
(display line-with-newline real-output-port))
|
(display line-with-newline real-output-port))
|
||||||
(loop (get-line port-to-read-from)))))))3
|
(lambda (key . args)
|
||||||
|
(display
|
||||||
|
(simple-format
|
||||||
|
#f
|
||||||
|
"
|
||||||
|
error: ~A: ~A
|
||||||
|
error: could not insert log part: '~A'\n\n"
|
||||||
|
key args line)
|
||||||
|
real-output-port)
|
||||||
|
(catch #t
|
||||||
|
(lambda ()
|
||||||
|
(insert
|
||||||
|
logging-conn
|
||||||
|
job-id
|
||||||
|
(simple-format
|
||||||
|
#f
|
||||||
|
"
|
||||||
|
guix-data-service: error: missing log line: ~A
|
||||||
|
\n" key)))
|
||||||
|
(lambda ()
|
||||||
|
#t)))))
|
||||||
|
(loop (get-line port-to-read-from)))))))
|
||||||
|
|
||||||
port-to-write-to)))
|
port-to-write-to)))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue