Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ chrono = "0.4.44"
chrono-english = "0.1" # Natural language date parsing
base64 = "0.22" # Base64 decoding for MIME-encoded email bodies

[dev-dependencies]
# Tests reach lance's WriteParams, which lancedb does not re-export. Pin
# the exact version lancedb resolves to, so the two cannot drift apart.
lance = { version = "=4.0.0", default-features = false }

[[bin]]
name = "semcode-index"
path = "src/bin/index.rs"
Expand Down
12 changes: 8 additions & 4 deletions src/bin/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1202,7 +1202,8 @@ async fn main() -> Result<()> {
// combined working set triggers the OOM killer.
println!("\nCompacting lore tables...");
match db_manager.compact_lore_tables().await {
Ok(_) => println!("Lore table compaction completed successfully"),
Ok(true) => println!("Lore table compaction completed successfully"),
Ok(false) => {}
Err(e) => error!("Failed to compact lore tables: {}", e),
}

Expand All @@ -1216,7 +1217,8 @@ async fn main() -> Result<()> {
Err(e) => eprintln!("Warning: Failed to ensure FTS indices: {}", e),
}
match db_manager.optimize_lore_fts_indices().await {
Ok(_) => println!("FTS indices updated successfully"),
Ok(true) => println!("FTS indices updated successfully"),
Ok(false) => {}
Err(e) => eprintln!("Warning: Failed to optimize FTS indices: {}", e),
}
}
Expand Down Expand Up @@ -1376,7 +1378,8 @@ async fn main() -> Result<()> {
if total_new_emails > 0 {
println!("\nCompacting lore tables...");
match db_manager.compact_lore_tables().await {
Ok(_) => println!("Lore table compaction completed successfully"),
Ok(true) => println!("Lore table compaction completed successfully"),
Ok(false) => {}
Err(e) => error!("Failed to compact lore tables: {}", e),
}

Expand All @@ -1386,7 +1389,8 @@ async fn main() -> Result<()> {
Err(e) => eprintln!("Warning: Failed to ensure FTS indices: {}", e),
}
match db_manager.optimize_lore_fts_indices().await {
Ok(_) => println!("FTS indices updated successfully"),
Ok(true) => println!("FTS indices updated successfully"),
Ok(false) => {}
Err(e) => eprintln!("Warning: Failed to optimize FTS indices: {}", e),
}
}
Expand Down
6 changes: 4 additions & 2 deletions src/database/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,8 @@ impl DatabaseManager {
self.schema_manager.compact_and_cleanup().await
}

pub async fn compact_lore_tables(&self) -> Result<()> {
/// Returns false, after printing the problem, if any table failed.
pub async fn compact_lore_tables(&self) -> Result<bool> {
self.schema_manager.compact_lore_tables().await
}

Expand All @@ -909,7 +910,8 @@ impl DatabaseManager {
}

/// Merge newly-inserted rows into existing lore FTS indices.
pub async fn optimize_lore_fts_indices(&self) -> Result<()> {
/// Returns false, after printing why, if the merge was skipped.
pub async fn optimize_lore_fts_indices(&self) -> Result<bool> {
self.schema_manager.optimize_lore_fts_indices().await
}

Expand Down
Loading
Loading