mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-04-01 09:50:33 +08:00
Make the DNF minrate setting configurable when loading repos
This commit is contained in:
@@ -689,6 +689,13 @@ class Config(object):
|
||||
"default": "master",
|
||||
"desc": "Denotes the branch used for rawhide.",
|
||||
},
|
||||
"dnf_minrate": {
|
||||
"type": int,
|
||||
"default": 1024 * 100, # 100KB
|
||||
"desc": "The minrate configuration on a DNF repo. This configuration will cause DNF to "
|
||||
"timeout loading a repo if the download speed is below minrate for the "
|
||||
"duration of the timeout."
|
||||
}
|
||||
}
|
||||
|
||||
def __init__(self, conf_section_obj):
|
||||
|
||||
@@ -362,7 +362,9 @@ def _get_rpms_in_external_repo(repo_url, arches, cache_dir_name):
|
||||
canon_arch = koji.canonArch(arch)
|
||||
repo_name = "repo_{}".format(canon_arch)
|
||||
repo_arch_url = repo_url.replace("$arch", canon_arch)
|
||||
base.repos.add_new_repo(repo_name, dnf_conf, baseurl=[repo_arch_url])
|
||||
base.repos.add_new_repo(
|
||||
repo_name, dnf_conf, baseurl=[repo_arch_url], minrate=conf.dnf_minrate,
|
||||
)
|
||||
|
||||
try:
|
||||
# Load the repos in parallel
|
||||
|
||||
@@ -419,8 +419,11 @@ def test_get_rpms_in_external_repo(mock_makedirs, mock_dnf_base):
|
||||
|
||||
# Test that i686 is mapped to i386 using the koji.canonArch().
|
||||
mock_dnf_base.return_value.repos.add_new_repo.assert_called_with(
|
||||
'repo_i386', mock_dnf_base.return_value.conf,
|
||||
baseurl=['http://domain.local/repo/latest/i386/'])
|
||||
"repo_i386",
|
||||
mock_dnf_base.return_value.conf,
|
||||
baseurl=["http://domain.local/repo/latest/i386/"],
|
||||
minrate=conf.dnf_minrate,
|
||||
)
|
||||
|
||||
|
||||
def test_get_rpms_in_external_repo_invalid_repo_url():
|
||||
|
||||
Reference in New Issue
Block a user