feat: update finalize to return Result<()> and simplify save mode

Co-authored-by: aider (openai/andrew/openrouter/qwen/qwen3-coder) <aider@aider.chat>
This commit is contained in:
Andrew Phillips
2025-08-18 08:12:49 -03:00
parent f11070dc60
commit 22206de5ab
5 changed files with 43 additions and 105 deletions

View File

@@ -209,20 +209,10 @@ fn process_input_stream(
}
debug!("MAIN: Ending IO loop after {:?} bytes", item.size);
// Finalize meta plugins and save their metadata
// Finalize meta plugins
for meta_plugin in meta_plugins.iter_mut() {
match meta_plugin.finalize() {
Ok(value) => {
// Only save non-empty values (empty means already saved during initialize/update)
if !value.is_empty() {
if let Err(e) = meta_plugin.save_meta(conn, item_id, value) {
eprintln!("Warning: Failed to save meta value: {}", e);
}
}
}
Err(e) => {
eprintln!("Warning: Failed to finalize meta plugin: {}", e);
}
if let Err(e) = meta_plugin.finalize() {
eprintln!("Warning: Failed to finalize meta plugin: {}", e);
}
}