mirror of
https://github.com/status-im/status-python-sdk.git
synced 2026-08-31 14:11:07 +00:00
- Initial documentation with how to run the project - Store `create_account_and_login` credentials locally so they can be reused when messaging - Script can be ran with arguments
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.")
|