diff options
| -rw-r--r-- | src/client.rs | 10 | ||||
| -rw-r--r-- | src/config.rs | 2 |
2 files changed, 6 insertions, 6 deletions
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 { | |||
| 138 | .opts(Options::new().relay_limits(RelayLimits::disable())) | 138 | .opts(Options::new().relay_limits(RelayLimits::disable())) |
| 139 | .signer(&opts.keys.unwrap_or(nostr::Keys::generate())) | 139 | .signer(&opts.keys.unwrap_or(nostr::Keys::generate())) |
| 140 | // .database( | 140 | // .database( |
| 141 | // SQLiteDatabase::open(get_dirs()?.config_dir().join("cache.sqlite")).await?, | 141 | // SQLiteDatabase::open(get_dirs()?.cache_dir().join("nostr-cache.sqlite")). |
| 142 | // ) | 142 | // await?, ) |
| 143 | .build(), | 143 | .build(), |
| 144 | fallback_relays: opts.fallback_relays, | 144 | fallback_relays: opts.fallback_relays, |
| 145 | more_fallback_relays: opts.more_fallback_relays, | 145 | more_fallback_relays: opts.more_fallback_relays, |
| @@ -689,11 +689,11 @@ async fn get_local_cache_database(git_repo_path: &Path) -> Result<SQLiteDatabase | |||
| 689 | 689 | ||
| 690 | async fn get_global_cache_database(git_repo_path: &Path) -> Result<SQLiteDatabase> { | 690 | async fn get_global_cache_database(git_repo_path: &Path) -> Result<SQLiteDatabase> { |
| 691 | SQLiteDatabase::open(if std::env::var("NGITTEST").is_err() { | 691 | SQLiteDatabase::open(if std::env::var("NGITTEST").is_err() { |
| 692 | create_dir_all(get_dirs()?.config_dir()).context(format!( | 692 | create_dir_all(get_dirs()?.cache_dir()).context(format!( |
| 693 | "cannot create cache directory in: {:?}", | 693 | "cannot create cache directory in: {:?}", |
| 694 | get_dirs()?.config_dir() | 694 | get_dirs()?.cache_dir() |
| 695 | ))?; | 695 | ))?; |
| 696 | get_dirs()?.config_dir().join("cache.sqlite") | 696 | get_dirs()?.cache_dir().join("nostr-cache.sqlite") |
| 697 | } else { | 697 | } else { |
| 698 | git_repo_path.join(".git/test-global-cache.sqlite") | 698 | git_repo_path.join(".git/test-global-cache.sqlite") |
| 699 | }) | 699 | }) |
diff --git a/src/config.rs b/src/config.rs index f5dba98..547fe7e 100644 --- a/src/config.rs +++ b/src/config.rs | |||
| @@ -5,7 +5,7 @@ use nostr_sdk::Timestamp; | |||
| 5 | use serde::{self, Deserialize, Serialize}; | 5 | use serde::{self, Deserialize, Serialize}; |
| 6 | 6 | ||
| 7 | pub fn get_dirs() -> Result<ProjectDirs> { | 7 | pub fn get_dirs() -> Result<ProjectDirs> { |
| 8 | ProjectDirs::from("", "CodeCollaboration", "ngit").ok_or(anyhow!( | 8 | ProjectDirs::from("", "", "ngit").ok_or(anyhow!( |
| 9 | "should find operating system home directories with rust-directories crate" | 9 | "should find operating system home directories with rust-directories crate" |
| 10 | )) | 10 | )) |
| 11 | } | 11 | } |