You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: crates/extensions/tedge_log_manager/src/manager/log_utils.rs
+5
Original file line number
Diff line number
Diff line change
@@ -37,11 +37,14 @@ pub fn new_read_logs(
37
37
break;
38
38
}
39
39
Err(error) => {
40
+
temp_file.flush()?;
40
41
returnErr(error);
41
42
}
42
43
};
43
44
}
44
45
46
+
temp_file.flush()?;
47
+
45
48
Ok(temp_path)
46
49
}
47
50
@@ -329,6 +332,7 @@ mod tests {
329
332
let data = "this is the first line.\nthis is the second line.\nthis is the third line.\nthis is the forth line.\nthis is the fifth line.";
330
333
331
334
log_file.write_all(data.as_bytes()).unwrap();
335
+
log_file.flush().unwrap();
332
336
333
337
let line_counter = 0;
334
338
let max_lines = 4;
@@ -381,6 +385,7 @@ mod tests {
381
385
let data = &format!("this is the first line of {file_name}.\nthis is the second line of {file_name}.\nthis is the third line of {file_name}.\nthis is the forth line of {file_name}.\nthis is the fifth line of {file_name}.");
382
386
383
387
log_file.write_all(data.as_bytes()).unwrap();
388
+
log_file.flush().unwrap();
384
389
385
390
let new_mtime = FileTime::from_unix_time(m_time,0);
0 commit comments