From: Siraaj Khandkar Date: Tue, 23 Mar 2021 14:15:38 +0000 (-0400) Subject: Sync log-writer for all commands X-Git-Tag: 0.15.0~8 X-Git-Url: https://git.xandkar.net/?a=commitdiff_plain;h=0d3f753c4263b2eed4030499edbfc084335bd44e;p=tt.git Sync log-writer for all commands not just download. --- diff --git a/tt.rkt b/tt.rkt index 1cb90cf..5db66ea 100644 --- a/tt.rkt +++ b/tt.rkt @@ -400,8 +400,8 @@ (log-message (current-logger) 'fatal 'stop "Exiting." #f) (thread-wait log-writer)) -(: logger-start (-> Log-Level Thread)) -(define (logger-start level) +(: log-writer-start (-> Log-Level Thread)) +(define (log-writer-start level) (let* ([logger (make-logger #f #f level #f)] [log-receiver @@ -437,7 +437,7 @@ "u, upload : Upload your twtxt file (alias to execute ~/.tt/upload)." "" #:args (command . args) - (define log-writer (logger-start log-level)) + (define log-writer (log-writer-start log-level)) (current-command-line-arguments (list->vector args)) (match command [(or "d" "download") @@ -454,8 +454,7 @@ #:args (filename) (define-values (_res _cpu real-ms _gc) (time-apply timeline-download (list num-workers (file->peers filename)))) - (log-info "Timeline downloaded in ~a seconds." (/ real-ms 1000.0)) - (log-writer-stop log-writer)))] + (log-info "Timeline downloaded in ~a seconds." (/ real-ms 1000.0))))] [(or "u" "upload") (command-line #:program @@ -482,5 +481,5 @@ "Long output format" (set! out-format 'multi-line)] #:args (filename) - (timeline-print out-format (timeline-read order (file->peers filename)))))] - )))) + (timeline-print out-format (timeline-read order (file->peers filename)))))]) + (log-writer-stop log-writer))))