From 38eb128dd3b79b29bf7a961dbe9b54a35d395a06 Mon Sep 17 00:00:00 2001 From: vaw Date: Sun, 22 Mar 2026 16:17:11 +0100 Subject: [PATCH] Store event cache in `~/.config/iamb` --- src/config.rs | 5 +++++ src/tests.rs | 1 + src/worker.rs | 6 +++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/config.rs b/src/config.rs index e7a4a47b..193c5d5a 100644 --- a/src/config.rs +++ b/src/config.rs @@ -866,6 +866,7 @@ pub struct ApplicationSettings { pub session_json_old: PathBuf, pub sled_dir: PathBuf, pub sqlite_dir: PathBuf, + pub sqlite_cache_dir: PathBuf, pub profile_name: String, pub profile: ProfileConfig, pub tunables: TunableValues, @@ -999,12 +1000,16 @@ impl ApplicationSettings { let mut layout_json = cache_dir.clone(); layout_json.push("layout.json"); + let mut sqlite_cache_dir = cache_dir; + sqlite_cache_dir.push("sqlite"); + let settings = ApplicationSettings { sled_dir, layout_json, session_json, session_json_old, sqlite_dir, + sqlite_cache_dir, profile_name, profile, tunables, diff --git a/src/tests.rs b/src/tests.rs index e9b05021..c810f060 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -212,6 +212,7 @@ pub fn mock_settings() -> ApplicationSettings { session_json_old: PathBuf::new(), sled_dir: PathBuf::new(), sqlite_dir: PathBuf::new(), + sqlite_cache_dir: PathBuf::new(), profile_name: "test".into(), profile: ProfileConfig { diff --git a/src/worker.rs b/src/worker.rs index f3c9791a..3eb47adc 100644 --- a/src/worker.rs +++ b/src/worker.rs @@ -725,7 +725,11 @@ async fn create_client_inner( // Set up the Matrix client for the selected profile. let builder = Client::builder() .http_client(http) - .sqlite_store(settings.sqlite_dir.as_path(), None) + .sqlite_store_with_cache_path( + settings.sqlite_dir.as_path(), + settings.sqlite_cache_dir.as_path(), + None, + ) .request_config(req_config) .with_encryption_settings(DEFAULT_ENCRYPTION_SETTINGS);