mirror of
https://github.com/miurahr/aqtinstall.git
synced 2025-12-18 13:14:37 +03:00
It's no secret that we need a random number!
This commit is contained in:
@@ -25,7 +25,7 @@ import json
|
|||||||
import logging.config
|
import logging.config
|
||||||
import os
|
import os
|
||||||
import posixpath
|
import posixpath
|
||||||
import random
|
import secrets
|
||||||
import sys
|
import sys
|
||||||
import xml.etree.ElementTree as ElementTree
|
import xml.etree.ElementTree as ElementTree
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
@@ -144,7 +144,7 @@ def retry_on_errors(action: Callable[[], any], acceptable_errors: Tuple, num_ret
|
|||||||
|
|
||||||
def retry_on_bad_connection(function: Callable[[str], any], base_url: str):
|
def retry_on_bad_connection(function: Callable[[str], any], base_url: str):
|
||||||
logger = getLogger("aqt.helper")
|
logger = getLogger("aqt.helper")
|
||||||
fallback_url = random.choice(Settings.fallbacks)
|
fallback_url = secrets.choice(Settings.fallbacks)
|
||||||
try:
|
try:
|
||||||
return function(base_url)
|
return function(base_url)
|
||||||
except ArchiveConnectionError:
|
except ArchiveConnectionError:
|
||||||
|
|||||||
Reference in New Issue
Block a user