perf: simplify method signatures and reduce clone across multiple files (#1663)

This commit is contained in:
Tunglies
2025-12-09 16:47:57 +08:00
committed by GitHub
parent 2bc51daa98
commit fe4dff5df0
33 changed files with 62 additions and 81 deletions
+1 -1
View File
@@ -509,7 +509,7 @@ impl StatsManager {
let counters = Arc::new(DashMap::new());
// Start cleanup task only if we're in a tokio runtime
let counters_clone = Arc::downgrade(&counters.clone());
let counters_clone = Arc::downgrade(&counters);
let cleanup_task = tokio::spawn(async move {
let mut interval = interval(Duration::from_secs(60)); // Check every minute
loop {
@@ -90,7 +90,7 @@ where
/// Rotates old files to make room for a new one.
/// This may result in the deletion of the oldest file
fn rotate_files(&mut self) -> io::Result<()> {
fn rotate_files(&self) -> io::Result<()> {
// ignore any failure removing the oldest file (may not exist)
let _ = fs::remove_file(self.filename_for(self.max_filecount.max(1)));
let mut r = Ok(());