Skip to content

Commit

Permalink
Fix ReadTimeout getting blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
moisses89 committed Jul 18, 2023
1 parent 9a2034c commit 9184723
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions safe_transaction_service/history/indexers/ethereum_indexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from django.db.models import Min, QuerySet

from celery.exceptions import SoftTimeLimitExceeded
from requests import Timeout

from gnosis.eth import EthereumClient

Expand Down Expand Up @@ -393,7 +394,12 @@ def process_addresses(
to_block_number,
current_block_number=current_block_number,
)
except (FindRelevantElementsException, SoftTimeLimitExceeded) as e:
processed_elements = self.process_elements(elements)
except (
FindRelevantElementsException,
SoftTimeLimitExceeded,
Timeout,
) as e:
self.block_process_limit = 1 # Set back to the very minimum
logger.info(
"%s: block_process_limit set back to %d",
Expand All @@ -402,8 +408,6 @@ def process_addresses(
)
raise e

processed_elements = self.process_elements(elements)

if not self.update_monitored_addresses(
addresses, from_block_number, to_block_number
):
Expand Down

0 comments on commit 9184723

Please sign in to comment.