Clean up RPCClient retry handling: only retry on 429, after a little sleep (#10182) (#10184)

automerge
This commit is contained in:
mergify[bot]
2020-05-25 11:41:46 -07:00
committed by GitHub
parent 9adf8b4fc8
commit 8fe8a5717e
5 changed files with 51 additions and 131 deletions

View File

@@ -38,12 +38,7 @@ impl MockRpcClientRequest {
}
impl GenericRpcClientRequest for MockRpcClientRequest {
fn send(
&self,
request: RpcRequest,
params: serde_json::Value,
_retries: usize,
) -> Result<serde_json::Value> {
fn send(&self, request: RpcRequest, params: serde_json::Value) -> Result<serde_json::Value> {
if let Some(value) = self.mocks.write().unwrap().remove(&request) {
return Ok(value);
}