Skip to content

Commit

Permalink
fix: add uploading R2 logs
Browse files Browse the repository at this point in the history
  • Loading branch information
fuxiaohei committed Mar 27, 2024
1 parent d2d7d83 commit 770ae71
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions crates/kernel/src/tasks/deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<mpsc::Sender<DeployTask>> = OnceCell::new();
Expand Down Expand Up @@ -110,6 +110,7 @@ struct UploadResult {
pub size: i32,
}

#[instrument("[UP]", skip_all)]
async fn upload_wasm(
target_wasm: String,
project_domain: String,
Expand All @@ -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,
Expand Down

0 comments on commit 770ae71

Please sign in to comment.