From 0dd81f599d5cf1715d6f85efdbe7d1e21df2bfb7 Mon Sep 17 00:00:00 2001 From: rustmailer Date: Fri, 22 May 2026 22:21:46 +0800 Subject: [PATCH] update --- crates/admin/src/main.rs | 2 +- crates/admin/src/migrate.rs | 18 ++++++------------ crates/core/src/store/blob.rs | 12 +++++++++--- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/crates/admin/src/main.rs b/crates/admin/src/main.rs index 3c06821..10e7752 100644 --- a/crates/admin/src/main.rs +++ b/crates/admin/src/main.rs @@ -43,7 +43,7 @@ async fn run_interactive() { let main_options = vec![ "Reset Admin Password", - "Migrate Legacy v0.3.7 Storage to v1.0.x", + "Migrate Legacy v0.3.7 Storage to v1.x", "Exit", ]; diff --git a/crates/admin/src/migrate.rs b/crates/admin/src/migrate.rs index d1a30b4..4de0896 100644 --- a/crates/admin/src/migrate.rs +++ b/crates/admin/src/migrate.rs @@ -11,7 +11,7 @@ use indicatif::{ProgressBar, ProgressStyle}; pub fn handle_migration(theme: &ColorfulTheme) { println!( "\n{}", - style("MIGRATION: Bichon v0.3.7 Storage Architecture → v1.0.x") + style("MIGRATION: Bichon v0.3.7 Storage Architecture → v1.x") .bold() .yellow() ); @@ -20,7 +20,7 @@ pub fn handle_migration(theme: &ColorfulTheme) { "{}", style( "This tool migrates data from the legacy v0.3.7 Tantivy-based storage \ - architecture to the new v1.0.x \ + architecture to the new v1.x \ separated index and Fjall-backed storage format." ) .dim() @@ -32,7 +32,7 @@ pub fn handle_migration(theme: &ColorfulTheme) { "Legacy v0.3.7 architecture:\n\ • envelope metadata stored in Tantivy\n\ • message data stored in Tantivy\n\n\ - New v1.0.x architecture:\n\ + New v1.x architecture:\n\ • mail indexes stored in Tantivy\n\ • attachment indexes stored in Tantivy\n\ • raw message data stored in Fjall\n\ @@ -163,7 +163,7 @@ pub fn handle_migration(theme: &ColorfulTheme) { println!("----------------------------------------"); println!( - "\n{} Checking legacy v0.x storage layout...", + "\n{} Checking legacy v0.3.7 storage layout...", style("⌛").yellow() ); @@ -172,7 +172,7 @@ pub fn handle_migration(theme: &ColorfulTheme) { println!( "{} {}", style("✔").green(), - style("Legacy v0.3.7 Tantivy-based storage detected. Migration to v1.0 is required.") + style("Legacy v0.3.7 Tantivy-based storage detected. Migration to v1.x is required.") .yellow() ); } @@ -186,7 +186,7 @@ pub fn handle_migration(theme: &ColorfulTheme) { println!( "{}", style( - "The selected directories may already be using the v1.0 storage architecture." + "The selected directories may already be using the v1.x storage architecture." ) .dim() ); @@ -288,12 +288,6 @@ pub fn handle_migration(theme: &ColorfulTheme) { style(batch_size).cyan().bold() ); - println!( - "{} Using batch size: {}\n", - style("✓").green(), - style(batch_size).cyan().bold() - ); - let legacy = LegacyDirs::new(index_path.clone(), data_path.clone()); let total_segments = match count_eml_segments(&legacy) { Ok(n) => n, diff --git a/crates/core/src/store/blob.rs b/crates/core/src/store/blob.rs index 0fa2128..11af21a 100644 --- a/crates/core/src/store/blob.rs +++ b/crates/core/src/store/blob.rs @@ -68,7 +68,9 @@ impl BlobManager { } } Err(e) => tracing::error!("Fjall email_ks error: {:?}", e), - _ => {} + Ok(true) => { + tracing::debug!("Email blob already exists (dedup): {}", &email_hash); + } } if let Some(attachments) = eml.attachments { @@ -80,7 +82,9 @@ impl BlobManager { } } Err(e) => tracing::error!("Fjall attach_ks error: {:?}", e), - _ => {} + Ok(true) => { + tracing::debug!("Attachment blob already exists (dedup): {}", &a_hash); + } } } } @@ -185,7 +189,9 @@ impl BlobManager { } pub async fn queue(&self, email: DetachedEmail) { - let _ = self.sender.send(email).await; + if let Err(e) = self.sender.send(email).await { + tracing::error!("BlobManager channel closed, email lost: {:#?}", e); + } } pub fn get_email(&self, content_hash: &str) -> BichonResult> {