Skip to content

Commit

Permalink
convert print() to logoger.info()
Browse files Browse the repository at this point in the history
  • Loading branch information
wakamex committed Nov 9, 2022
1 parent 537e16b commit f7e464b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ape_alchemy/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from ape.api import UpstreamProvider, Web3Provider
from ape.exceptions import ContractLogicError, ProviderError, VirtualMachineError
from ape.logging import logger
from evm_trace import CallTreeNode, ParityTraceList, TraceFrame, get_calltree_from_parity_trace
from requests import HTTPError
from web3 import HTTPProvider, Web3
Expand Down Expand Up @@ -153,7 +154,7 @@ def _make_request(self, endpoint: str, parameters: list,min_retry_delay:int = 10
)
if "exceeded its compute units" in message:
retry_interval = min(max_retry_delay, min_retry_delay * retry_backoff_factor ** i)
print(f"Alchemy compute units exceeded, retrying #{i} in {retry_interval} ms")
logger.info(f"Alchemy compute units exceeded, retrying #{i} in {retry_interval} ms")
delay = retry_interval + random.randint(0, retry_jitter)
time.sleep(delay / 1000)
continue
Expand Down

0 comments on commit f7e464b

Please sign in to comment.