From 4990c65d254cec6328136af4bd2d05b766b4016e Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Sun, 14 Sep 2025 23:29:45 +0800 Subject: fix(httpconnector): retry the actual request in TOO_MANY_REQUESTS fixup! perf(httpconnector): unified handle_response --- src/client/connector/httpconnector.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/client/connector/httpconnector.rs b/src/client/connector/httpconnector.rs index 985d9c0..b8369fe 100644 --- a/src/client/connector/httpconnector.rs +++ b/src/client/connector/httpconnector.rs @@ -36,15 +36,16 @@ impl HTTPConnector { }) } + #[allow(clippy::only_used_in_recursion)] fn handle_response RequestBuilder>( &self, - resp: F, + req: F, ) -> Result<::Ok, ::Err> { - match resp().send() { + match req().send() { Ok(resp) => match resp.status() { StatusCode::TOO_MANY_REQUESTS => { sleep(Duration::from_secs(5)); - self.update() + self.handle_response(req) } status => { if !status.is_success() { -- cgit v1.2.3