Skip to content

Commit cf5d0d4

Browse files
authored
optimize pulling the license (#33768)
* optimize pulling the license * change python
1 parent 73d254b commit cf5d0d4

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

sdks/java/container/license_scripts/pull_licenses_java.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,17 @@
3939
from urllib.request import urlopen, Request, URLError, HTTPError
4040

4141
SOURCE_CODE_REQUIRED_LICENSES = ['lgpl', 'gpl', 'cddl', 'mpl', 'gnu', 'mozilla public license']
42-
RETRY_NUM = 9
43-
THREADS = 16
42+
RETRY_NUM = 12
43+
THREADS = 8
4444

45-
# workaround of a breaking change introduced in tenacity 8.5+
45+
# workaround of a breaking change introduced in tenacity 8.5+
4646
# See https://github.com/jd/tenacity/issues/486
4747
def resolve_retry_number(retried_fn):
4848
return retried_fn.retry.statistics.get("attempt_number") or \
4949
retried_fn.statistics.get("attempt_number")
5050

5151
@retry(reraise=True,
52-
wait=wait_fixed(5),
52+
wait=wait_fixed(10),
5353
stop=stop_after_attempt(RETRY_NUM))
5454
def pull_from_url(file_name, url, dep, no_list):
5555
if url == 'skip':

sdks/python/container/license_scripts/pull_licenses_py.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def copy_license_files(dep):
7575
@retry(
7676
reraise=True,
7777
wait=wait_exponential(multiplier=2),
78-
stop=stop_after_attempt(5))
78+
stop=stop_after_attempt(10))
7979
def pull_from_url(dep, configs):
8080
'''
8181
:param dep: name of a dependency

0 commit comments

Comments
 (0)