This commit is contained in:
parent
ff1607d623
commit
c2f3a8ddad
2 changed files with 20 additions and 14 deletions
31
src/main.rs
31
src/main.rs
|
@ -56,20 +56,23 @@ async fn launch(config: String) {
|
||||||
..Default::default()
|
..Default::default()
|
||||||
})
|
})
|
||||||
.mount_assets()
|
.mount_assets()
|
||||||
.mount("/", routes![
|
.mount(
|
||||||
routes::index_page,
|
"/",
|
||||||
routes::pkg_route,
|
routes![
|
||||||
routes::push::upload_pkg,
|
routes::index_page,
|
||||||
routes::user::login,
|
routes::pkg_route,
|
||||||
routes::user::login_post,
|
routes::push::upload_pkg,
|
||||||
routes::user::account_page,
|
routes::user::login,
|
||||||
routes::ui::pkg_ui,
|
routes::user::login_post,
|
||||||
routes::ui::repo_ui,
|
routes::user::account_page,
|
||||||
routes::user::new_api_key,
|
routes::ui::pkg_ui,
|
||||||
routes::user::end_session,
|
routes::ui::repo_ui,
|
||||||
routes::user::change_password,
|
routes::user::new_api_key,
|
||||||
routes::user::change_password_post
|
routes::user::end_session,
|
||||||
])
|
routes::user::change_password,
|
||||||
|
routes::user::change_password_post
|
||||||
|
],
|
||||||
|
)
|
||||||
.manage(config)
|
.manage(config)
|
||||||
.manage(shell)
|
.manage(shell)
|
||||||
.launch()
|
.launch()
|
||||||
|
|
|
@ -107,13 +107,16 @@ impl MirrorRepository {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn get_pkg(&self, pkg_name: &str, mirrorlist: &Mirrorlist) -> Option<Package> {
|
pub async fn get_pkg(&self, pkg_name: &str, mirrorlist: &Mirrorlist) -> Option<Package> {
|
||||||
|
log::info!("Requesting mirrored package {pkg_name}");
|
||||||
if let Some(pkg) = self.inner.get_pkg(pkg_name) {
|
if let Some(pkg) = self.inner.get_pkg(pkg_name) {
|
||||||
|
log::info!("Found mirrored package {pkg_name}");
|
||||||
return Some(pkg);
|
return Some(pkg);
|
||||||
}
|
}
|
||||||
|
|
||||||
// PKG
|
// PKG
|
||||||
let (name, _, _, arch, _) = Package::extract_pkg_name(pkg_name).unwrap();
|
let (name, _, _, arch, _) = Package::extract_pkg_name(pkg_name).unwrap();
|
||||||
|
|
||||||
|
log::info!("Not Found. Downloading mirrored package {pkg_name}");
|
||||||
self.download_package(pkg_name, &name, arch.clone(), mirrorlist.for_arch(arch))
|
self.download_package(pkg_name, &name, arch.clone(), mirrorlist.for_arch(arch))
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue