From eb53b7ec0306fd0c1cc89203858d07676f4cce10 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Thu, 18 Jul 2024 13:31:52 +0100 Subject: refactor(fetch): move database cache into cache directory rather than config directories also removed CodeCollaboration from path as this isn't helpful whilst this is a breaking change, the cache was only introduced during development of this version so it is not highlighted as such --- src/client.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/client.rs') diff --git a/src/client.rs b/src/client.rs index 17e98b0..4e5a9d4 100644 --- a/src/client.rs +++ b/src/client.rs @@ -138,8 +138,8 @@ impl Connect for Client { .opts(Options::new().relay_limits(RelayLimits::disable())) .signer(&opts.keys.unwrap_or(nostr::Keys::generate())) // .database( - // SQLiteDatabase::open(get_dirs()?.config_dir().join("cache.sqlite")).await?, - // ) + // SQLiteDatabase::open(get_dirs()?.cache_dir().join("nostr-cache.sqlite")). + // await?, ) .build(), fallback_relays: opts.fallback_relays, more_fallback_relays: opts.more_fallback_relays, @@ -689,11 +689,11 @@ async fn get_local_cache_database(git_repo_path: &Path) -> Result Result { SQLiteDatabase::open(if std::env::var("NGITTEST").is_err() { - create_dir_all(get_dirs()?.config_dir()).context(format!( + create_dir_all(get_dirs()?.cache_dir()).context(format!( "cannot create cache directory in: {:?}", - get_dirs()?.config_dir() + get_dirs()?.cache_dir() ))?; - get_dirs()?.config_dir().join("cache.sqlite") + get_dirs()?.cache_dir().join("nostr-cache.sqlite") } else { git_repo_path.join(".git/test-global-cache.sqlite") }) -- cgit v1.2.3