diff --git a/src/database/key_value/globals.rs b/src/database/key_value/globals.rs index e24c6047..6c8e5b7d 100644 --- a/src/database/key_value/globals.rs +++ b/src/database/key_value/globals.rs @@ -116,6 +116,8 @@ impl service::globals::Data for KeyValueDatabase { fn cleanup(&self) -> Result<()> { self.db.cleanup() } + fn flush(&self) -> Result<()> { self.db.flush() } + fn memory_usage(&self) -> String { let pdu_cache = self.pdu_cache.lock().unwrap().len(); let shorteventid_cache = self.shorteventid_cache.lock().unwrap().len(); diff --git a/src/service/globals/data.rs b/src/service/globals/data.rs index 1ae76d21..a829938e 100644 --- a/src/service/globals/data.rs +++ b/src/service/globals/data.rs @@ -17,6 +17,7 @@ pub trait Data: Send + Sync { fn update_check_for_updates_id(&self, id: u64) -> Result<()>; async fn watch(&self, user_id: &UserId, device_id: &DeviceId) -> Result<()>; fn cleanup(&self) -> Result<()>; + fn flush(&self) -> Result<()>; fn memory_usage(&self) -> String; fn clear_caches(&self, amount: u32); fn load_keypair(&self) -> Result; diff --git a/src/service/globals/mod.rs b/src/service/globals/mod.rs index c0b2db3c..ec069588 100644 --- a/src/service/globals/mod.rs +++ b/src/service/globals/mod.rs @@ -274,6 +274,8 @@ impl Service<'_> { pub fn cleanup(&self) -> Result<()> { self.db.cleanup() } + pub fn flush(&self) -> Result<()> { self.db.flush() } + pub fn server_name(&self) -> &ServerName { self.config.server_name.as_ref() } pub fn max_request_size(&self) -> u32 { self.config.max_request_size }