Use line buffering for the input and output ports
As these are used for logging, which is done on a line by line basis. Remove the now redundant calls to (force-output).
This commit is contained in:
parent
7f0a0ed3b1
commit
3df0b43146
4 changed files with 6 additions and 7 deletions
|
|
@ -33,13 +33,11 @@
|
||||||
|
|
||||||
(define (log-time action f)
|
(define (log-time action f)
|
||||||
(simple-format #t "debug: Starting ~A\n" action)
|
(simple-format #t "debug: Starting ~A\n" action)
|
||||||
(force-output)
|
|
||||||
(let* ((start-time (current-time))
|
(let* ((start-time (current-time))
|
||||||
(result (f))
|
(result (f))
|
||||||
(time-taken (- (current-time) start-time)))
|
(time-taken (- (current-time) start-time)))
|
||||||
(simple-format #t "debug: Finished ~A, took ~A seconds\n"
|
(simple-format #t "debug: Finished ~A, took ~A seconds\n"
|
||||||
action time-taken)
|
action time-taken)
|
||||||
(force-output)
|
|
||||||
result))
|
result))
|
||||||
|
|
||||||
(define (all-inferior-package-derivations store inf packages)
|
(define (all-inferior-package-derivations store inf packages)
|
||||||
|
|
@ -124,7 +122,6 @@
|
||||||
(package-name package)
|
(package-name package)
|
||||||
key
|
key
|
||||||
args)
|
args)
|
||||||
(force-output)
|
|
||||||
(exit 1))
|
(exit 1))
|
||||||
(begin
|
(begin
|
||||||
(simple-format
|
(simple-format
|
||||||
|
|
@ -133,7 +130,6 @@
|
||||||
(package-name package)
|
(package-name package)
|
||||||
key
|
key
|
||||||
args)
|
args)
|
||||||
(force-output)
|
|
||||||
'()))))))
|
'()))))))
|
||||||
(list ,@(map inferior-package-id packages)))))
|
(list ,@(map inferior-package-id packages)))))
|
||||||
|
|
||||||
|
|
@ -425,7 +421,6 @@
|
||||||
"Failed extracting information from commit: ~A\n\n" commit)
|
"Failed extracting information from commit: ~A\n\n" commit)
|
||||||
(simple-format (current-error-port)
|
(simple-format (current-error-port)
|
||||||
" ~A ~A\n\n" key args)
|
" ~A ~A\n\n" key args)
|
||||||
(force-output)
|
|
||||||
#f)))))
|
#f)))))
|
||||||
|
|
||||||
(define (store-item-for-git-repository-id-and-commit
|
(define (store-item-for-git-repository-id-and-commit
|
||||||
|
|
|
||||||
|
|
@ -362,7 +362,6 @@ ORDER BY derivations.system DESC,
|
||||||
(simple-format
|
(simple-format
|
||||||
#t "debug: ensure-input-derivations-exist: processing ~A derivations\n"
|
#t "debug: ensure-input-derivations-exist: processing ~A derivations\n"
|
||||||
(length input-derivation-file-names))
|
(length input-derivation-file-names))
|
||||||
(force-output)
|
|
||||||
(let* ((existing-derivation-entries
|
(let* ((existing-derivation-entries
|
||||||
(derivation-file-names->vhash conn
|
(derivation-file-names->vhash conn
|
||||||
derivation-ids-hash-table
|
derivation-ids-hash-table
|
||||||
|
|
@ -443,7 +442,6 @@ ORDER BY derivations.system DESC,
|
||||||
|
|
||||||
(simple-format
|
(simple-format
|
||||||
#t "debug: insert-missing-derivations: ensure-input-derivations-exist\n")
|
#t "debug: insert-missing-derivations: ensure-input-derivations-exist\n")
|
||||||
(force-output)
|
|
||||||
|
|
||||||
(ensure-input-derivations-exist (deduplicate-strings
|
(ensure-input-derivations-exist (deduplicate-strings
|
||||||
(map derivation-input-path
|
(map derivation-input-path
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,9 @@
|
||||||
(guix-data-service database)
|
(guix-data-service database)
|
||||||
(guix-data-service jobs))
|
(guix-data-service jobs))
|
||||||
|
|
||||||
|
(setvbuf (current-output-port) 'line)
|
||||||
|
(setvbuf (current-error-port) 'line)
|
||||||
|
|
||||||
(with-postgresql-connection
|
(with-postgresql-connection
|
||||||
(lambda (conn)
|
(lambda (conn)
|
||||||
(simple-format #t "Ready to process jobs...\n")
|
(simple-format #t "Ready to process jobs...\n")
|
||||||
|
|
|
||||||
|
|
@ -80,6 +80,9 @@
|
||||||
(error "extraneous argument" arg))
|
(error "extraneous argument" arg))
|
||||||
%default-options))
|
%default-options))
|
||||||
|
|
||||||
|
(setvbuf (current-output-port) 'line)
|
||||||
|
(setvbuf (current-error-port) 'line)
|
||||||
|
|
||||||
(let ((opts (parse-options (cdr (program-arguments)))))
|
(let ((opts (parse-options (cdr (program-arguments)))))
|
||||||
(let ((repl-port (assoc-ref opts 'listen-repl)))
|
(let ((repl-port (assoc-ref opts 'listen-repl)))
|
||||||
(when repl-port
|
(when repl-port
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue