fix: log retry intervals

This commit is contained in:
Yujia Qiao 2022-01-13 21:25:01 +08:00
parent 2de9147a0f
commit 91b38cbe5f
No known key found for this signature in database
GPG Key ID: DC129173B148701B
2 changed files with 6 additions and 6 deletions

View File

@ -176,8 +176,8 @@ async fn do_data_channel_handshake<T: Transport>(
.await
.with_context(|| "Failed to connect to remote_addr")?)
},
|e, _| {
warn!("{:?}", e);
|e, duration| {
warn!("{:?}. Retry in {:?}", e, duration);
},
)
.await?;

View File

@ -507,8 +507,8 @@ fn tcp_listen_and_send(
// FIXME: Respect shutdown signal
let l = backoff::future::retry_notify(listen_backoff(), || async {
Ok(TcpListener::bind(&addr).await?)
}, |e, _| {
error!("{:?}", e);
}, |e, duration| {
error!("{:?}. Retry in {:?}", e, duration);
})
.await
.with_context(|| "Failed to listen for the service");
@ -618,8 +618,8 @@ async fn run_udp_connection_pool<T: Transport>(
.await
.with_context(|| "Failed to listen for the service")?)
},
|e, _| {
warn!("{:?}", e);
|e, duration| {
warn!("{:?}. Retry in {:?}", e, duration);
},
)
.await