Skip to content

Commit

Permalink
chore: Update some docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Nukesor committed Feb 22, 2025
1 parent c9257de commit 51bf844
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pueue_lib/src/log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ pub fn clean_log_handles(task_id: usize, pueue_dir: &Path) {
/// Return type is `(Vec<u8>, bool)`
/// - `Vec<u8>` the compressed task output.
/// - `bool` Whether the full task's output has been read. `false` indicate that the log output has
/// been truncated
/// been truncated.
pub fn read_and_compress_log_file(
task_id: usize,
pueue_dir: &Path,
Expand All @@ -74,14 +74,16 @@ pub fn read_and_compress_log_file(
let mut content = Vec::new();

// Indicates whether the full log output is shown or just the last part of it.
// This may be true even if, for example, only the last 15 lines were requested
// but the log is only 10 lines long.
let mut output_complete = true;

// Move the cursor to the last few lines of both files.
// If requested, move the cursor to the last few lines of the file.
if let Some(lines) = lines {
output_complete = seek_to_last_lines(&mut file, lines)?;
}

// Compress the full log input and pipe it into the snappy compressor
// Pipe the remaining log output file it into the snappy compressor
{
let mut compressor = FrameEncoder::new(&mut content);
io::copy(&mut file, &mut compressor)
Expand Down

0 comments on commit 51bf844

Please sign in to comment.