Skip to content

Commit

Permalink
Fix compile error
Browse files Browse the repository at this point in the history
  • Loading branch information
Geometrically committed Dec 19, 2022
1 parent 2fe19c8 commit 04b4c5a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/routes/download.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub async fn handle_version_download(
let url =
make_cdn_url(&cdn, &format!("data/{hash}/versions/{version}/{file}"))?;

if let Err(error) = count_download(&req, &ctx, &url).await {
if let Err(error) = count_download(&req, &ctx).await {
console_error!(
"Error encountered while trying to count download: {error}",
);
Expand Down Expand Up @@ -55,7 +55,6 @@ pub fn handle_download(
async fn count_download(
req: &Request,
ctx: &RouteContext<()>,
forward_url: &Url,
) -> Result<()> {
if let Some(ip) = req.headers().get(CF_IP_HEADER)? {
let (project, file) = (get_param(ctx, "hash"), get_param(ctx, "file"));
Expand Down Expand Up @@ -138,14 +137,15 @@ async fn count_download(
let labrinth_secret = ctx.secret(LABRINTH_SECRET)?.to_string();
let hash = get_param(ctx, "hash").to_owned();
let version_name = get_param(ctx, "version").to_owned();
let og_url = req.url()?.to_string();

wasm_bindgen_futures::spawn_local(async move {
match request_download_count(
&labrinth_url,
&labrinth_secret,
&hash,
&version_name,
req.url()?.to_string(),
og_url,
)
.await
{
Expand Down

0 comments on commit 04b4c5a

Please sign in to comment.