Skip to content

Commit

Permalink
server: try live mirror first, before falling back to archlinux archive
Browse files Browse the repository at this point in the history
  • Loading branch information
djugei committed May 1, 2024
1 parent 8c2fc3b commit 2130d5d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ use async_file_cache::FileCache;

use parsing::{Delta, Package};

const MIRROR: &str = "http://europe.archive.pkgbuild.com/packages/.all/";
const FALLBACK_MIRROR: &str = "http://mirror.f4st.host/archlinux/pool/packages/";
const MIRROR: &str = "http://mirror.f4st.host/archlinux/pool/packages/";
const FALLBACK_MIRROR: &str = "http://europe.archive.pkgbuild.com/packages/.all/";
const LOCAL: &str = "./deltaserver/";

type Str = Box<str>;
Expand Down Expand Up @@ -49,7 +49,7 @@ fn main() {
let mut response = client.get(uri).send().await?;

if response.status() == reqwest::StatusCode::NOT_FOUND {
// fall back to live mirror
// fall back to archive mirror
info!("using fallback mirror for {key}");
let mut uri = String::new();
uri.push_str(FALLBACK_MIRROR);
Expand Down

0 comments on commit 2130d5d

Please sign in to comment.