From c2f3a8ddad596cd4de586b15cfaafd957ab03a57 Mon Sep 17 00:00:00 2001 From: JMARyA Date: Tue, 22 Apr 2025 21:03:12 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20fix=20logging?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.rs | 31 +++++++++++++++++-------------- src/pkg/mirror.rs | 3 +++ 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/src/main.rs b/src/main.rs index 2789dbe..2dd137f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -56,20 +56,23 @@ async fn launch(config: String) { ..Default::default() }) .mount_assets() - .mount("/", routes![ - routes::index_page, - routes::pkg_route, - routes::push::upload_pkg, - routes::user::login, - routes::user::login_post, - routes::user::account_page, - routes::ui::pkg_ui, - routes::ui::repo_ui, - routes::user::new_api_key, - routes::user::end_session, - routes::user::change_password, - routes::user::change_password_post - ]) + .mount( + "/", + routes![ + routes::index_page, + routes::pkg_route, + routes::push::upload_pkg, + routes::user::login, + routes::user::login_post, + routes::user::account_page, + routes::ui::pkg_ui, + routes::ui::repo_ui, + routes::user::new_api_key, + routes::user::end_session, + routes::user::change_password, + routes::user::change_password_post + ], + ) .manage(config) .manage(shell) .launch() diff --git a/src/pkg/mirror.rs b/src/pkg/mirror.rs index d17bd06..22006db 100644 --- a/src/pkg/mirror.rs +++ b/src/pkg/mirror.rs @@ -107,13 +107,16 @@ impl MirrorRepository { } pub async fn get_pkg(&self, pkg_name: &str, mirrorlist: &Mirrorlist) -> Option { + log::info!("Requesting mirrored package {pkg_name}"); if let Some(pkg) = self.inner.get_pkg(pkg_name) { + log::info!("Found mirrored package {pkg_name}"); return Some(pkg); } // PKG 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)) .await;