Skip to content

Commit 8b1079c

Browse files
committed
feat: add retry notification
1 parent f3958af commit 8b1079c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/robust_provider.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,12 @@ impl<N: Network> RobustProvider<N> {
279279

280280
match timeout(
281281
self.max_timeout,
282-
(|| operation(provider.clone())).retry(retry_strategy).sleep(tokio::time::sleep),
282+
(|| operation(provider.clone()))
283+
.retry(retry_strategy)
284+
.notify(|err: &RpcError<TransportErrorKind>, dur: Duration| {
285+
info!(error = %err, "RPC error retrying after {:?}", dur);
286+
})
287+
.sleep(tokio::time::sleep),
283288
)
284289
.await
285290
{

0 commit comments

Comments
 (0)