[packagekit] yumbackend metadata_expire in mediarepo
James Antill
james at fedoraproject.org
Wed Jul 29 09:55:52 PDT 2009
On Wed, 2009-07-29 at 18:24 +0300, مؤيد السعدي wrote:
> elif lazy_cache:
> for repo in self.yumbase.repos.listEnabled():
> + if repo.mediaid: continue
> repo.metadata_expire = 60 * 60 * 24 # 24 hours
> repo.mdpolicy = "group:all"
I can see that this fixes it for the media repos. ... but it's still
wrong.
What are you trying to do in the above? My guess is "set a higher than
normal expire time" and the mdpolicy forced change doesn't make much
sense, my guess is that's copied from some other bit of code?¹
However this fails in the above desire for anything which has a higher
than 24 hours expire time already (due to repo. knowledge that PK
doesn't have, Eg. the fedora release repo.). Or, as with the media
repo., anything that has a -1 expire (maybe the user is using yum like
apt/etc.).
Similarly the override of the default 6 hours to the old default of 1.5
hours, in the "default" code path, seems suspicious at best.
Also I'm not sure why you set metadata_expire for all repos. with -1
when there is "no network", and then turn on caching only mode (the
later would do the same thing on it's own).
¹ Or maybe this was supposed to go into refresh_cache() instead of the
weird hard coded update of some of the data, with no revert, hack that
is there atm.
--
James Antill <james at fedoraproject.org>
Fedora
More information about the PackageKit
mailing list