Skip to content

Commit

Permalink
add BlockNotFoundError to ignored errors for try call rpc block (#145)
Browse files Browse the repository at this point in the history
* add BlockNotFoundError to ignored errors for try call rpc block

* add ruff

---------

Co-authored-by: Oleksandr Prudnikov <[email protected]>
  • Loading branch information
Grommash9 and Oleksandr Prudnikov authored Jan 27, 2025
1 parent 19c42b8 commit 247ce8a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [9.2.0]
- add BlockNotFoundError to ignored errors for try call rpc block

## [9.1.0]
- Fix TON monitoring - stop trying to pull not existing blocks

Expand Down
4 changes: 2 additions & 2 deletions aiotx/clients/_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import aiohttp

from aiotx.exceptions import RpcConnectionError
from aiotx.exceptions import BlockNotFoundError, RpcConnectionError
from aiotx.log import logger


Expand Down Expand Up @@ -169,7 +169,7 @@ async def _make_request_with_retry(self, request_func, *args, **kwargs):
for attempt in range(self.max_retries):
try:
return await request_func(*args, **kwargs)
except RpcConnectionError as e:
except (RpcConnectionError, BlockNotFoundError) as e:
if attempt < self.max_retries - 1:
delay = self.retry_delay * (2**attempt)
logger.warning(
Expand Down

0 comments on commit 247ce8a

Please sign in to comment.