Skip to content

Commit

Permalink
add extra logs
Browse files Browse the repository at this point in the history
  • Loading branch information
itegulov committed Nov 17, 2023
1 parent 685830c commit c09a439
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions node/src/http_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ pub async fn message<U: IntoUrl>(
url: U,
message: MpcMessage,
) -> Result<(), SendError> {
let _span = tracing::info_span!("message_request");
let mut url = url.into_url().unwrap();
url.set_path("msg");
tracing::debug!(%url, "making http request");
let action = || async {
let response = client
.post(url.clone())
Expand Down Expand Up @@ -56,18 +58,16 @@ pub async fn message<U: IntoUrl>(
Retry::spawn(retry_strategy, action).await
}

pub async fn join<U: IntoUrl>(
client: &Client,
url: U,
participant: &Participant,
) -> Result<(), SendError> {
pub async fn join<U: IntoUrl>(client: &Client, url: U, me: &Participant) -> Result<(), SendError> {
let _span = tracing::info_span!("join_request", ?me);
let mut url = url.into_url().unwrap();
url.set_path("join");
tracing::debug!(%url, "making http request");
let action = || async {
let response = client
.post(url.clone())
.header("content-type", "application/json")
.json(&participant)
.json(&me)
.send()
.await
.map_err(SendError::ReqwestClientError)?;
Expand Down

0 comments on commit c09a439

Please sign in to comment.