This is an automated email from the ASF dual-hosted git repository.
xqhu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git
The following commit(s) were added to refs/heads/master by this push:
new cf5d0d43149 optimize pulling the license (#33768)
cf5d0d43149 is described below
commit cf5d0d43149c65c4c104bdc56c839c31b5cd5960
Author: liferoad <[email protected]>
AuthorDate: Mon Jan 27 08:59:59 2025 -0500
optimize pulling the license (#33768)
* optimize pulling the license
* change python
---
sdks/java/container/license_scripts/pull_licenses_java.py | 8 ++++----
sdks/python/container/license_scripts/pull_licenses_py.py | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/sdks/java/container/license_scripts/pull_licenses_java.py
b/sdks/java/container/license_scripts/pull_licenses_java.py
index 61d36d3bac1..e076930f347 100644
--- a/sdks/java/container/license_scripts/pull_licenses_java.py
+++ b/sdks/java/container/license_scripts/pull_licenses_java.py
@@ -39,17 +39,17 @@ from tenacity import wait_fixed
from urllib.request import urlopen, Request, URLError, HTTPError
SOURCE_CODE_REQUIRED_LICENSES = ['lgpl', 'gpl', 'cddl', 'mpl', 'gnu', 'mozilla
public license']
-RETRY_NUM = 9
-THREADS = 16
+RETRY_NUM = 12
+THREADS = 8
-# workaround of a breaking change introduced in tenacity 8.5+
+# workaround of a breaking change introduced in tenacity 8.5+
# See https://github.com/jd/tenacity/issues/486
def resolve_retry_number(retried_fn):
return retried_fn.retry.statistics.get("attempt_number") or \
retried_fn.statistics.get("attempt_number")
@retry(reraise=True,
- wait=wait_fixed(5),
+ wait=wait_fixed(10),
stop=stop_after_attempt(RETRY_NUM))
def pull_from_url(file_name, url, dep, no_list):
if url == 'skip':
diff --git a/sdks/python/container/license_scripts/pull_licenses_py.py
b/sdks/python/container/license_scripts/pull_licenses_py.py
index fc37cda3631..a5cfef974d5 100644
--- a/sdks/python/container/license_scripts/pull_licenses_py.py
+++ b/sdks/python/container/license_scripts/pull_licenses_py.py
@@ -75,7 +75,7 @@ def copy_license_files(dep):
@retry(
reraise=True,
wait=wait_exponential(multiplier=2),
- stop=stop_after_attempt(5))
+ stop=stop_after_attempt(10))
def pull_from_url(dep, configs):
'''
:param dep: name of a dependency