fix: move CACHE declaration inside get_cache_path function
This commit is contained in:
@@ -4,10 +4,10 @@ use color_eyre::eyre::{OptionExt as _, WrapErr as _};
|
||||
|
||||
use crate::config::APP_DIRECTORY_NAME;
|
||||
|
||||
static CACHE: tokio::sync::OnceCell<PathBuf> =
|
||||
tokio::sync::OnceCell::const_new();
|
||||
|
||||
pub async fn get_cache_path() -> crate::Result<PathBuf> {
|
||||
static CACHE: tokio::sync::OnceCell<PathBuf> =
|
||||
tokio::sync::OnceCell::const_new();
|
||||
|
||||
Ok(CACHE
|
||||
.get_or_try_init(async || -> crate::Result<PathBuf> {
|
||||
let mut path = tokio::task::spawn_blocking(dirs::cache_dir)
|
||||
|
||||
Reference in New Issue
Block a user