solver: Call update_cache

DNF apparently doesn't check the expiration time on the cache unless you
call this first. It may help improve issues with the cache being out of
sync.

Internally dnf checks the mtime of the main repomd.xml file when using
baseurl, and it checks the hash values when using metalink so this
should not result in any noticeable extra slowdowns when things are
fresh.
This commit is contained in:
Brian C. Lane 2025-04-30 08:24:15 -07:00 committed by Achilleas Koutsou
parent 841985691c
commit 59fe07a6ab

View file

@ -86,6 +86,7 @@ class DNF(SolverBase):
repo_config.sslclientcert = modify_rootdir_path(repo_config.sslclientcert, root_dir)
repo_config.sslclientkey = modify_rootdir_path(repo_config.sslclientkey, root_dir)
self.base.update_cache()
self.base.fill_sack(load_system_repo=False)
except dnf.exceptions.Error as e:
raise RepoError(e) from e