Finalize 0.8.1 release (#2182)

* Finalize 0.8.1 release

* Remove console.logs

* Fix build

* add default to users

* update release conf

* fix again?

* fix build (again)

* actually fix build

* Update config dir

* Update config dir

* Fix dir again
This commit is contained in:
Geometrically
2024-08-20 17:53:14 -07:00
committed by GitHub
parent 3fca24e6fd
commit a19ce0458a
25 changed files with 504 additions and 117 deletions

View File

@@ -1,4 +1,5 @@
use crate::config::MODRINTH_API_URL;
use crate::state::{CacheBehaviour, CachedEntry};
use crate::util::fetch::{fetch_advanced, FetchSemaphore};
use chrono::{DateTime, Duration, TimeZone, Utc};
use dashmap::DashMap;
@@ -172,6 +173,23 @@ impl ModrinthCredentials {
Ok(())
}
pub(crate) async fn refresh_all() -> crate::Result<()> {
let state = crate::State::get().await?;
let all = Self::get_all(&state.pool).await?;
let user_ids = all.into_iter().map(|x| x.0).collect::<Vec<_>>();
CachedEntry::get_user_many(
&user_ids.iter().map(|x| &**x).collect::<Vec<_>>(),
Some(CacheBehaviour::Bypass),
&state.pool,
&state.fetch_semaphore,
)
.await?;
Ok(())
}
}
#[derive(Serialize, Debug)]