make dnf timeout configurable

This commit is contained in:
Mike McLean
2019-12-19 12:13:17 -05:00
parent 36ca88115e
commit 0d66e24a05
2 changed files with 7 additions and 1 deletions

View File

@@ -661,7 +661,12 @@ class Config(object):
"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."
}
},
"dnf_timeout": {
"type": int,
"default": 30,
"desc": "The timeout configuration for dnf operations, in seconds."
},
}
def __init__(self, conf_section_obj):

View File

@@ -366,6 +366,7 @@ def _get_rpms_in_external_repo(repo_url, arches, cache_dir_name):
dnf_conf.cachedir = cache_location
# Don't skip repos that can't be synchronized
dnf_conf.skip_if_unavailable = False
dnf_conf.timeout = conf.dnf_timeout
# Get rid of everything to be sure it's a blank slate. This doesn't delete the cached repo data.
base.reset(repos=True, goal=True, sack=True)