diff --git a/crates/turborepo-lib/src/run/cache.rs b/crates/turborepo-lib/src/run/cache.rs index 4504206332f36..8e3eee1cc9a8c 100644 --- a/crates/turborepo-lib/src/run/cache.rs +++ b/crates/turborepo-lib/src/run/cache.rs @@ -196,10 +196,9 @@ impl TaskCache { pub fn output_writer(&self, writer: W) -> Result, Error> { let mut log_writer = LogWriter::default(); - // We always write a log file even if we do not cache it. This would - // allow users to "stream" specific logs from a single task if the TUI - // was being used. - log_writer.with_log_file(&self.log_file_path)?; + if !self.caching_disabled && !self.run_cache.writes_disabled { + log_writer.with_log_file(&self.log_file_path)?; + } match self.task_output_logs { OutputLogsMode::None | OutputLogsMode::HashOnly | OutputLogsMode::ErrorsOnly => {} diff --git a/crates/turborepo-process/src/child.rs b/crates/turborepo-process/src/child.rs index dcb9320cd2b23..43a0da2693bc0 100644 --- a/crates/turborepo-process/src/child.rs +++ b/crates/turborepo-process/src/child.rs @@ -582,18 +582,9 @@ impl Child { let writer_fut = async { let mut result = Ok(()); - loop { - match tokio::time::timeout(Duration::from_millis(200), byte_rx.recv()).await { - Ok(Some(bytes)) => { - result = stdout_pipe.write_all(&bytes); - } - Ok(None) => break, - Err(_) => { - // Flush the writer periodically if there hasn't been any new output - result = stdout_pipe.flush(); - } - } - if result.is_err() { + while let Some(bytes) = byte_rx.recv().await { + if let Err(err) = stdout_pipe.write_all(&bytes) { + result = Err(err); break; } } diff --git a/crates/turborepo-ui/src/logs.rs b/crates/turborepo-ui/src/logs.rs index a1f726f7eb288..6b7a4d7cfad67 100644 --- a/crates/turborepo-ui/src/logs.rs +++ b/crates/turborepo-ui/src/logs.rs @@ -38,9 +38,7 @@ impl LogWriter { Error::CannotWriteLogs(err) })?; - // We keep the buffer smaller to ensure the log file does not too far behind the - // displayed logs. - self.log_file = Some(BufWriter::with_capacity(512, log_file)); + self.log_file = Some(BufWriter::new(log_file)); Ok(()) }