Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add BlockNotFoundError to ignored errors for try call rpc block #145

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading