Skip to content
This repository has been archived by the owner on Jun 8, 2024. It is now read-only.

Commit

Permalink
fix a bug in file re-use
Browse files Browse the repository at this point in the history
  • Loading branch information
KodrAus committed Jan 22, 2024
1 parent ccfbc79 commit 40a7ef4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion targets/file/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use std::{
fs,
io::{self, Write},
mem,
ops::ControlFlow,
path::{Path, PathBuf},
sync::{Arc, Condvar, Mutex},
Expand Down Expand Up @@ -322,7 +323,7 @@ fn apply_retention(
let _ = fs::remove_file(path);
}

Ok(file_set.pop())
Ok(file_set.first_mut().map(mem::take))
}

struct Buffer {
Expand Down
4 changes: 2 additions & 2 deletions tests/smoke-test/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ async fn main() {
.scope("some-scope", "0.1", emit::props! {})
.spawn()
.unwrap())
.and_to(emit_metrics::plot_metrics_by_count(30, emit_term::stdout()))
//.and_to(emit_metrics::plot_metrics_by_count(30, emit_term::stdout()))
.and_to(
emit_file::set("./target/logs/log.txt")
.reuse_files(true)
Expand All @@ -47,7 +47,7 @@ async fn main() {
)
.init();

emit::setup().to(emit_term::stdout()).init_internal();
//emit::setup().to(emit_term::stdout()).init_internal();

sample_metrics();

Expand Down

0 comments on commit 40a7ef4

Please sign in to comment.