mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-05-07 02:09:06 +00:00
perf: simplify method signatures and reduce clone across multiple files (#1663)
This commit is contained in:
@@ -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(());
|
||||
|
||||
Reference in New Issue
Block a user