File tree Expand file tree Collapse file tree 1 file changed +9
-12
lines changed Expand file tree Collapse file tree 1 file changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -108,16 +108,14 @@ impl<S: Sleeper> AsyncClient<S> {
108
108
109
109
}
110
110
111
- //----------------------------------------not needed since no client struct in async minreq------------------------------------
112
- // pub fn from_client(url: String, client: Client) -> Self {
113
- // AsyncClient {
114
- // url,
115
- // client,
116
- // max_retries: crate::DEFAULT_MAX_RETRIES,
117
- // marker: PhantomData,
118
- // }
119
- // }
120
- //-----------------------------------------------------------------------------------------------
111
+ pub fn from_client ( url : String , client : Client ) -> Self {
112
+ AsyncClient {
113
+ url,
114
+ headers,
115
+ max_retries : crate :: DEFAULT_MAX_RETRIES ,
116
+ marker : PhantomData ,
117
+ }
118
+ }
121
119
/// Make an HTTP GET request to given URL, deserializing to any `T` that
122
120
/// implement [`bitcoin::consensus::Decodable`].
123
121
///
@@ -507,8 +505,7 @@ impl<S: Sleeper> AsyncClient<S> {
507
505
508
506
} ,
509
507
Err ( e) => {
510
- // Here you might inspect the error (if possible) to decide whether to retry.
511
- // For simplicity, we retry on any error until max_retries is reached.
508
+
512
509
if attempts < self . max_retries {
513
510
S :: sleep ( delay) . await ;
514
511
attempts += 1 ;
You can’t perform that action at this time.
0 commit comments