diff options
| author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-07-20 23:00:06 +0200 |
|---|---|---|
| committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-07-20 23:00:06 +0200 |
| commit | 2f671f196e245ac1a791c001286e401a2fab9d3a (patch) | |
| tree | be90d8f16d5c8b65c6b77ebe1359d22e9738bbf6 /crates/client/src/command/client.rs | |
| parent | chore: Commit (diff) | |
| download | atuin-2f671f196e245ac1a791c001286e401a2fab9d3a.zip | |
chore: Commit
Diffstat (limited to '')
| -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; |
