Skip to content

Commit

Permalink
fixed logging + increased send timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
babymotte committed Aug 23, 2023
1 parent 91d1cc6 commit 51324aa
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions worterbuch/src/server/poem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ impl ClientHandler {
},
recv = rx.recv() => if let Some(text) = recv {
let msg = Message::text(text);
self.send_with_timeout(msg).await.context("Error sending keepalive signal")?;
self.send_with_timeout(msg).await.context("Error sending message to client")?;
} else {
break;
},
Expand Down Expand Up @@ -425,7 +425,10 @@ impl ClientHandler {
self.last_keepalive_tx = Instant::now();
Ok(r?)
},
_ = sleep(Duration::from_secs(1)) => Err(anyhow!("Send timeout")),
_ = sleep(Duration::from_secs(5)) => {
log::error!("Send timeout");
Err(anyhow!("Send timeout"))
},
}
}
}

0 comments on commit 51324aa

Please sign in to comment.