diff options
Diffstat (limited to 'crates/client/src/command/client.rs')
| -rw-r--r-- | crates/client/src/command/client.rs | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/crates/client/src/command/client.rs b/crates/client/src/command/client.rs index 32686c23..60329500 100644 --- a/crates/client/src/command/client.rs +++ b/crates/client/src/command/client.rs @@ -1,6 +1,3 @@ -use std::fs::{self}; -use std::path::Path; - use clap::Subcommand; use eyre::{Result, WrapErr}; @@ -8,34 +5,6 @@ use tracing_subscriber::filter::EnvFilter; use crate::atuin_client::settings::Settings; -fn cleanup_old_logs(log_dir: &Path, prefix: &str, retention_days: u64) { - let cutoff = std::time::SystemTime::now() - - std::time::Duration::from_secs(retention_days * 24 * 60 * 60); - - let Ok(entries) = fs::read_dir(log_dir) else { - return; - }; - - for entry in entries.flatten() { - let path = entry.path(); - let Some(name) = path.file_name().and_then(|n| n.to_str()) else { - continue; - }; - - // Match files like "search.log.2024-02-23" or "daemon.log.2024-02-23" - if !name.starts_with(prefix) || name == prefix { - continue; - } - - if let Ok(metadata) = entry.metadata() - && let Ok(modified) = metadata.modified() - && modified < cutoff - { - drop(fs::remove_file(&path)); - } - } -} - mod config; mod daemon; mod default_config; |
