File tree Expand file tree Collapse file tree 3 files changed +7
-19
lines changed Expand file tree Collapse file tree 3 files changed +7
-19
lines changed Original file line number Diff line number Diff line change @@ -196,10 +196,9 @@ impl TaskCache {
196196 pub fn output_writer < W : Write > ( & self , writer : W ) -> Result < LogWriter < W > , Error > {
197197 let mut log_writer = LogWriter :: default ( ) ;
198198
199- // We always write a log file even if we do not cache it. This would
200- // allow users to "stream" specific logs from a single task if the TUI
201- // was being used.
202- log_writer. with_log_file ( & self . log_file_path ) ?;
199+ if !self . caching_disabled && !self . run_cache . writes_disabled {
200+ log_writer. with_log_file ( & self . log_file_path ) ?;
201+ }
203202
204203 match self . task_output_logs {
205204 OutputLogsMode :: None | OutputLogsMode :: HashOnly | OutputLogsMode :: ErrorsOnly => { }
Original file line number Diff line number Diff line change @@ -582,18 +582,9 @@ impl Child {
582582
583583 let writer_fut = async {
584584 let mut result = Ok ( ( ) ) ;
585- loop {
586- match tokio:: time:: timeout ( Duration :: from_millis ( 200 ) , byte_rx. recv ( ) ) . await {
587- Ok ( Some ( bytes) ) => {
588- result = stdout_pipe. write_all ( & bytes) ;
589- }
590- Ok ( None ) => break ,
591- Err ( _) => {
592- // Flush the writer periodically if there hasn't been any new output
593- result = stdout_pipe. flush ( ) ;
594- }
595- }
596- if result. is_err ( ) {
585+ while let Some ( bytes) = byte_rx. recv ( ) . await {
586+ if let Err ( err) = stdout_pipe. write_all ( & bytes) {
587+ result = Err ( err) ;
597588 break ;
598589 }
599590 }
Original file line number Diff line number Diff line change @@ -38,9 +38,7 @@ impl<W: Write> LogWriter<W> {
3838 Error :: CannotWriteLogs ( err)
3939 } ) ?;
4040
41- // We keep the buffer smaller to ensure the log file does not too far behind the
42- // displayed logs.
43- self . log_file = Some ( BufWriter :: with_capacity ( 512 , log_file) ) ;
41+ self . log_file = Some ( BufWriter :: new ( log_file) ) ;
4442
4543 Ok ( ( ) )
4644 }
You can’t perform that action at this time.
0 commit comments