Explorar el Código

app: remove last sled references

x hace 2 días
padre
commit
208afff192
Se han modificado 2 ficheros con 4 adiciones y 7 borrados
  1. 2 4
      bin/app/src/app/mod.rs
  2. 2 3
      bin/app/src/plugin/darkirc.rs

+ 2 - 4
bin/app/src/app/mod.rs

@@ -72,7 +72,7 @@ pub struct App {
     /// Receiver side of the redraw queue, handed to the window in `setup()`.
     redraw_rx: async_channel::Receiver<()>,
     /// True if this is the first time the app has ever been run.
-    /// Loaded from the sled DB in `setup()`.
+    /// Loaded from the KVDB in `setup()`.
     pub is_first_time: AtomicBool,
 }
 
@@ -98,12 +98,10 @@ impl App {
         let setting_root = SceneNode::new("setting", SceneNodeType::SettingRoot);
         let setting_root = setting_root.setup_null();
         let settings_tree = db.open_tree_default("settings").unwrap();
-
-        let flags_tree = db.open_tree("app_flags").unwrap();
+        let flags_tree = db.open_tree_default("app_flags").unwrap();
         let is_first_time = !flags_tree.contains_key(IS_FIRST_TIME_KEY).unwrap();
         if is_first_time {
             flags_tree.insert(IS_FIRST_TIME_KEY, b"").unwrap();
-            flags_tree.flush().unwrap();
         }
         self.is_first_time.store(is_first_time, Ordering::Relaxed);
         // Commenting this out since it doesnt compile when enable-plugins isnt enabled.

+ 2 - 3
bin/app/src/plugin/darkirc.rs

@@ -197,7 +197,7 @@ impl DarkIrc {
 
         i!("Starting DarkIRC backend");
 
-        let setting_tree = evgr_db.open_tree_default("settings")?;
+        let setting_tree = db.open_tree_default("settings")?;
         i!("Opened darkirc_settings tree from unified db");
 
         // Use the unified db for reading channels (UI stores channels there)
@@ -983,9 +983,8 @@ impl DarkIrc {
         let mut on_modify = OnModify::new(ex.clone(), self.node.clone(), me.clone());
         async fn save_nick(self_: Arc<DarkIrc>, _batch: BatchGuardPtr) {
             if let Err(err) = self_.nick_tree.insert(b"value", self_.nick.get().as_bytes()) {
-                e!("Failed persisting nick to sled: {err}");
+                e!("Failed persisting nick to kvdb: {err}");
             }
-            let _ = self_.nick_tree.flush();
         }
         on_modify.when_change(self.nick.prop(), save_nick);