fix: move CACHE declaration inside get_cache_path function

This commit is contained in:
monosans
2026-01-16 18:30:33 +03:00
parent 179d6eb1be
commit 2d96a5d08b
+3 -3
View File
@@ -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)