Skip to content

Commit

Permalink
Refactor advance_date_and_index a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
CBenoit committed Sep 6, 2023
1 parent 47dbcfe commit 1188eaa
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions tracing-appender/src/rolling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -971,19 +971,18 @@ impl Inner {
.compare_exchange(current, next_date, Ordering::AcqRel, Ordering::Acquire)
.is_ok();

if next_date_updated {
if let Some(index) = &self.log_filename_index {
match &self.log_filename_index {
Some(index) if next_date_updated => {
if current == next_date {
index.fetch_add(1, Ordering::SeqCst);
} else {
index.store(0, Ordering::Release);
}
}

true
} else {
false
_ => {}
}

next_date_updated
}
}

Expand Down

0 comments on commit 1188eaa

Please sign in to comment.