fix: remove saved_during_io from trait and add to BinaryMetaPlugin

Co-authored-by: aider (openai/andrew/openrouter/qwen/qwen3-coder) <aider@aider.chat>
This commit is contained in:
Andrew Phillips
2025-08-16 14:24:06 -03:00
parent 389bb59531
commit cfee32ff35
2 changed files with 14 additions and 2 deletions

View File

@@ -74,7 +74,6 @@ pub trait MetaPlugin {
value,
};
crate::db::store_meta(conn, meta)?;
self.saved_during_io = true;
Ok(())
}
}

View File

@@ -80,6 +80,19 @@ impl MetaPlugin for BinaryMetaPlugin {
self.conn = Some(conn as *const _ as *mut Connection);
Ok(())
}
fn save_meta(&mut self, conn: &Connection, item_id: i64, value: String) -> Result<()> {
let meta_name = self.meta_name();
debug!("Saving metadata: item_id={}, name={}, value={}", item_id, meta_name, value);
let meta = crate::db::Meta {
id: item_id,
name: meta_name,
value,
};
crate::db::store_meta(conn, meta)?;
self.saved_during_io = true;
Ok(())
}
}
impl CwdMetaPlugin {