Skip to content

Commit

Permalink
Cap the retry interval in the crawler
Browse files Browse the repository at this point in the history
Signed-off-by: Aurélien Bompard <[email protected]>
  • Loading branch information
abompard committed Jun 3, 2024
1 parent ce2b80e commit ab59d58
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mirrormanager2/crawler/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from mirrormanager2 import lib as mmlib

from .constants import RETRIES
from .constants import RETRIES, RETRIES_MAX_INTERVAL

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -74,6 +74,7 @@ def _get_file(self, url):
backoff.expo,
TryLater,
max_tries=RETRIES,
max_value=RETRIES_MAX_INTERVAL,
on_backoff=_on_backoff,
on_giveup=_on_giveup,
logger=None, # custom logging
Expand Down
1 change: 1 addition & 0 deletions mirrormanager2/crawler/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@

# Number of times to retry a connection
RETRIES = 10
RETRIES_MAX_INTERVAL = 10 # in seconds

0 comments on commit ab59d58

Please sign in to comment.