diff --git a/src/forgejo.rs b/src/forgejo.rs index b0f4df209e..13b5830ac5 100644 --- a/src/forgejo.rs +++ b/src/forgejo.rs @@ -1,7 +1,7 @@ use crate::cache::{CacheManager, CacheManagerBuilder}; use crate::config::Settings; use crate::tokens; -use crate::{dirs, duration, env}; +use crate::{dirs, env}; use eyre::Result; use heck::ToKebabCase; use reqwest::IntoUrl; @@ -47,7 +47,7 @@ async fn get_releases_cache(key: &str) -> RwLockReadGuard<'_, CacheGroup(key: &str) -> RwLockReadGuard<'a, CacheGroup RwLockReadGuard<'_, CacheGroup .entry(key.to_string()) .or_insert_with(|| { CacheManagerBuilder::new(cache_dir().join(format!("{key}-tags.msgpack.z"))) - .with_fresh_duration(Some(duration::DAILY)) + .with_fresh_duration(Settings::get().fetch_remote_versions_cache()) .build() }); TAGS_CACHE.read().await @@ -105,7 +105,7 @@ async fn get_releases_cache(key: &str) -> RwLockReadGuard<'_, CacheGroup(key: &str) -> RwLockReadGuard<'a, CacheGroup RwLockReadGuard<'_, CacheGroup .entry(key.to_string()) .or_insert_with(|| { CacheManagerBuilder::new(cache_dir().join(format!("{key}-tags.msgpack.z"))) - .with_fresh_duration(Some(duration::DAILY)) + .with_fresh_duration(Settings::get().fetch_remote_versions_cache()) .build() }); TAGS_CACHE.read().await @@ -82,7 +82,7 @@ async fn get_releases_cache(key: &str) -> RwLockReadGuard<'_, CacheGroup RwLockReadGuard<'_, CacheGroup