add serialization to write_gui_db

This commit is contained in:
kn0sys 2024-09-19 02:12:12 -04:00
parent f95b3e7548
commit 1f94d40f9f
No known key found for this signature in database
GPG key ID: 3BDB674C95F103FA

View file

@ -782,7 +782,8 @@ pub fn search_gui_db(f: String, data: String) -> Result<String, MdbError> {
pub fn write_gui_db(f: String, key: String, data: String) -> Result<(), MdbError> {
let db = &DATABASE_LOCK;
let k = format!("{}-{}", f, key);
db::write_chunks(&db.env, &db.handle, k.as_bytes(), data.as_bytes())?;
let v = bincode::serialize(&data).unwrap_or_default();
db::write_chunks(&db.env, &db.handle, k.as_bytes(), &v)?;
Ok(())
}