Skip to content

Commit

Permalink
add extra logs to help debugging (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
zzlk authored Feb 14, 2025
1 parent c3410e8 commit 4d0a242
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions crates/bwmapserver/src/actix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ use reqwest::ClientBuilder;
use std::collections::HashMap;
use std::time::Duration;
use tokio::io::AsyncReadExt;
use tracing::debug;
use tracing::{error, info};

#[derive(Clone, Debug, Deserialize)]
Expand Down Expand Up @@ -876,18 +877,23 @@ async fn start_file_pumper(reqwest_client: reqwest::Client) -> Result<()> {
continue;
};

info!(name: "gsfs put", sha256, GSFSFE_ENDPOINT = ?std::env::var("GSFSFE_ENDPOINT"));
if let Ok(endpoint) = std::env::var("GSFSFE_ENDPOINT") {
match tokio::time::timeout(
Duration::from_secs(2),
gsfs_put_mapblob(&reqwest_client, &endpoint, entry.path(), sha256),
)
.await
{
Ok(_) => {}
Ok(_) => {
info!(name: "successfully put to gsfs", sha256);
}
Err(error) => {
error!(name: "failed to put file to gsfs", %error);
error!(name: "failed to put file to gsfs", %error, sha256);
}
}
} else {
debug!(name: "skipping gsfs upload", sha256);
}

let mut file = match tokio::fs::File::open(entry.path()).await {
Expand Down

0 comments on commit 4d0a242

Please sign in to comment.