Bug 2124511

Summary: [dnf5] Add dedicated function to refresh metadata
Product: [Fedora] Fedora Reporter: Milan Crha <mcrha>
Component: libdnfAssignee: rpm-software-management
Status: NEW --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 38CC: daniel.mach, jmracek, jrohel, mblaha, mpitt, nsella, pkratoch, rpm-software-management
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Milan Crha 2022-09-06 11:47:10 UTC
The gnome-software has a dedicated function to refresh metadata, it's usually ran on start of the application, but can be also executed when needed. The function takes one argument, the `cache_age` in seconds. Caches not being that old are automatically skipped for the refresh. An explicit refresh can help to speed up execution of the following commands, the same as when the refresh happens during the dedicated time it's much better experience for the users.

A side note: the first time I ran the dnf5daemon-server and connected to it to list installed packages the dnf5daemon-server realized it has no/stale cache and begun to refresh the repository information. I have installed quite few repos, thus it took longer to download all the repo information. It took as much as the D-Bus call timed out. That led me to set unlimited time for the D-Bus calls to the dnf5daemon-server to avoid any such problem in the future.

Comment 1 Ben Cotton 2023-02-07 14:54:41 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 38 development cycle.
Changing version to 38.

Comment 2 Martin Pitt 2023-07-24 05:03:19 UTC
I just tested dnfdaemon again in https://issues.redhat.com/browse/COCKPIT-952 , and am happy to report that all crashes that I previously ran into now got fixed, thanks! So this missing API is the remaining gap which blocks us from moving to dnfdaemon in Cockpit.

Comment 3 Milan Crha 2023-07-25 10:30:33 UTC
It seems the 5.1.0 has `read_all_repos` method on the `org.rpm.dnf.v0.Base` interface. It does not contain the "cache_age" argument (in fact it has no argument at all), but if it's the way to go, then why not.

I think this can be closed, unless someone is willing to add the "cache_age" argument.