mirror of
https://github.com/status-im/status-go.git
synced 2026-08-31 00:51:12 +00:00
tests-functional/ -> test/functional/ tests-unit-network/ -> test/unit-network/ No Go code changes beyond the two package paths. Every reference follows: Makefile targets, the pytest-lint and reliability workflows, the three Jenkinsfiles, the root Dockerfile, pyrightconfig.json, .gitignore, the benchmark and functional-test scripts, and the docs. All paths inside the moved directories are self-contained (docker compose uses `context: .`, the Python helpers resolve from __file__), so the extra level of nesting does not reach outside. refs #7067
16 lines
636 B
Python
16 lines
636 B
Python
import logging
|
|
from time import sleep
|
|
|
|
|
|
# To be used when signals related to RPC requests are not present in the peer ndoe, ex for: requestToJoinCommunity.
|
|
def retry_call(func, *args, max_retries=40, retry_interval=0.5, **kwargs):
|
|
for attempt in range(max_retries):
|
|
try:
|
|
response = func(*args, **kwargs)
|
|
if response:
|
|
return response
|
|
except Exception as e:
|
|
logging.error(f"Attempt {attempt + 1}/{max_retries}: Unexpected error: {e}")
|
|
sleep(retry_interval)
|
|
raise Exception(f"Failed to execute {func.__name__} in {max_retries * retry_interval} seconds.")
|