Fix failed message's retry count
This commit is contained in:
parent
57e8cc40e3
commit
d40e22707a
1 changed files with 4 additions and 4 deletions
|
|
@ -48,13 +48,13 @@ class HttpClient:
|
||||||
"JSON parsing failed",
|
"JSON parsing failed",
|
||||||
)
|
)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.warning(
|
|
||||||
f"Request failed ({e}), {retry_count - i - 1} retries left",
|
|
||||||
)
|
|
||||||
if retry_count - i > 1:
|
if retry_count - i > 1:
|
||||||
|
logger.warning(
|
||||||
|
f"Request failed ({e}), {retry_count - i - 1} retries left",
|
||||||
|
)
|
||||||
await sleep(self.wait_between_retries_seconds)
|
await sleep(self.wait_between_retries_seconds)
|
||||||
|
|
||||||
raise RemoteCallError("Request has failed too many times")
|
raise RemoteCallError(f"Request has failed too many ({retry_count + 1}) times")
|
||||||
|
|
||||||
async def close(self) -> None:
|
async def close(self) -> None:
|
||||||
await self._session.close()
|
await self._session.close()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue