Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/svn/svn_retry.py
Show All 10 Lines | |||||
from tenacity.before_sleep import before_sleep_log | from tenacity.before_sleep import before_sleep_log | ||||
from tenacity.retry import retry_if_exception | from tenacity.retry import retry_if_exception | ||||
from tenacity.stop import stop_after_attempt | from tenacity.stop import stop_after_attempt | ||||
from tenacity.wait import wait_exponential | from tenacity.wait import wait_exponential | ||||
logger = logging.getLogger(__name__) | logger = logging.getLogger(__name__) | ||||
SVN_RETRY_WAIT_EXP_BASE = 10 | SVN_RETRY_WAIT_EXP_BASE = 10 | ||||
SVN_RETRY_MAX_ATTEMPTS = 5 | SVN_RETRY_MAX_ATTEMPTS = 3 | ||||
def is_retryable_svn_exception(exception): | def is_retryable_svn_exception(exception): | ||||
if isinstance(exception, SubversionException): | if isinstance(exception, SubversionException): | ||||
return exception.args[0].startswith( | return exception.args[0].startswith( | ||||
( | ( | ||||
"Connection timed out", | "Connection timed out", | ||||
"Unable to connect to a repository at URL", | "Unable to connect to a repository at URL", | ||||
Show All 15 Lines |