use http client from context

This commit is contained in:
seth 2024-04-26 20:53:13 -04:00
parent 921540e249
commit 84a7cfe151
No known key found for this signature in database
GPG key ID: D31BD0D494BBEE86
26 changed files with 148 additions and 149 deletions

View file

@ -192,19 +192,20 @@ async fn outdated_launcher(log: &str, data: &Data) -> Result<Issue> {
return Ok(None);
};
let octocrab = &data.octocrab;
let version_from_log = captures[0].replace("Prism Launcher version: ", "");
let latest_version = if let Some(storage) = &data.storage {
if let Ok(version) = storage.launcher_version().await {
version
} else {
let version = api::github::get_latest_prism_version().await?;
let version = api::github::get_latest_prism_version(octocrab).await?;
storage.cache_launcher_version(&version).await?;
version
}
} else {
trace!("Not caching launcher version, as we're running without a storage backend");
api::github::get_latest_prism_version().await?
api::github::get_latest_prism_version(octocrab).await?
};
if version_from_log < latest_version {