From 770ae714b08f4d352b85ea10a8f93eea54f8cc50 Mon Sep 17 00:00:00 2001 From: fuxiaohei Date: Wed, 27 Mar 2024 14:25:40 +0800 Subject: [PATCH] fix: add uploading R2 logs --- crates/kernel/src/tasks/deploy.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/crates/kernel/src/tasks/deploy.rs b/crates/kernel/src/tasks/deploy.rs index 733a4074..9ccd5f08 100644 --- a/crates/kernel/src/tasks/deploy.rs +++ b/crates/kernel/src/tasks/deploy.rs @@ -6,7 +6,7 @@ use land_dao::models::project::Model as ProjectModel; use land_dao::{playground, project}; use once_cell::sync::OnceCell; use tokio::sync::mpsc; -use tracing::{debug, info, warn}; +use tracing::{debug, info, instrument, warn}; /// global deploy task channel pub static DEPLOY_TASK_SENDER: OnceCell> = OnceCell::new(); @@ -110,6 +110,7 @@ struct UploadResult { pub size: i32, } +#[instrument("[UP]", skip_all)] async fn upload_wasm( target_wasm: String, project_domain: String, @@ -125,14 +126,15 @@ async fn upload_wasm( size = upload_data_size, "Uploading", ); - debug!( - "Uploading wasm to storage: {:?}, size: {}", - storage_file_name, upload_data_size - ); let global_storage = land_dao::storage::GLOBAL.lock().await; global_storage .write(&storage_file_name, upload_data) .await?; + info!( + file = storage_file_name, + size = upload_data_size, + "Upload success" + ); Ok(UploadResult { path: storage_file_name, md5: upload_data_md5,