Commit 0cd0155f9a

0cd0155f9a6914265abbfee5fed811e7635557a2

parent: 6d0cdbdfe1

Unregistered key

vaw <git@nlih.de> · 2026-09-11 23:45 UTC
committer: <noreply@github.com>

Store event cache in `~/.cache/iamb` (#596)

Layout: unified · split

src/config.rs +5
@@ -1210,6 +1210,7 @@ pub struct ApplicationSettings {
1210 pub session_json_old: PathBuf, 1210 pub session_json_old: PathBuf,
1211 pub sled_dir: PathBuf, 1211 pub sled_dir: PathBuf,
1212 pub sqlite_dir: PathBuf, 1212 pub sqlite_dir: PathBuf,
1213 pub sqlite_cache_dir: PathBuf,
1213 pub profile_name: String, 1214 pub profile_name: String,
1214 pub profile: ProfileConfig, 1215 pub profile: ProfileConfig,
1215 pub tunables: TunableValues, 1216 pub tunables: TunableValues,
@@ -1343,12 +1344,16 @@ impl ApplicationSettings {
1343 let mut layout_json = cache_dir.clone(); 1344 let mut layout_json = cache_dir.clone();
1344 layout_json.push("layout.json"); 1345 layout_json.push("layout.json");
1345 1346
1347 let mut sqlite_cache_dir = cache_dir;
1348 sqlite_cache_dir.push("sqlite");
1349
1346 let settings = ApplicationSettings { 1350 let settings = ApplicationSettings {
1347 sled_dir, 1351 sled_dir,
1348 layout_json, 1352 layout_json,
1349 session_json, 1353 session_json,
1350 session_json_old, 1354 session_json_old,
1351 sqlite_dir, 1355 sqlite_dir,
1356 sqlite_cache_dir,
1352 profile_name, 1357 profile_name,
1353 profile, 1358 profile,
1354 tunables, 1359 tunables,
src/tests.rs +1
@@ -204,6 +204,7 @@ pub fn mock_settings() -> ApplicationSettings {
204 session_json_old: PathBuf::new(), 204 session_json_old: PathBuf::new(),
205 sled_dir: PathBuf::new(), 205 sled_dir: PathBuf::new(),
206 sqlite_dir: PathBuf::new(), 206 sqlite_dir: PathBuf::new(),
207 sqlite_cache_dir: PathBuf::new(),
207 208
208 profile_name: "test".into(), 209 profile_name: "test".into(),
209 profile: ProfileConfig { 210 profile: ProfileConfig {
src/worker.rs +5 −1
@@ -824,7 +824,11 @@ async fn create_client_inner(
824 // Set up the Matrix client for the selected profile. 824 // Set up the Matrix client for the selected profile.
825 let builder = Client::builder() 825 let builder = Client::builder()
826 .http_client(http) 826 .http_client(http)
827 .sqlite_store(settings.sqlite_dir.as_path(), None) 827 .sqlite_store_with_cache_path(
828 settings.sqlite_dir.as_path(),
829 settings.sqlite_cache_dir.as_path(),
830 None,
831 )
828 .request_config(req_config) 832 .request_config(req_config)
829 .with_encryption_settings(DEFAULT_ENCRYPTION_SETTINGS); 833 .with_encryption_settings(DEFAULT_ENCRYPTION_SETTINGS);
830 834