ximion / appstream-generator

A fast AppStream metadata generator
GNU Lesser General Public License v3.0
43 stars 29 forks source link

keep N versions on cleanup #97

Open hsitter opened 3 years ago

hsitter commented 3 years ago

It'd be cool if cleanup could be told to keep the N last processed data sets of a component instead of only the latest.

Maybe add an ingestion timestamp to the database entries and use that a measure for how old a given data set is?

In kde neon we have some repos continuously integrate from git. This results in a large number of versions but out of those versions the N latest are conceivably "relevant", not only the latest. Currently we can't really use cleanup because it'd drop everything that isn't the current version and break screenshot resolution for systems that are still on the metadata from (e.g.) an hour ago.

ximion commented 2 years ago

Usually this isn't an issue as data doesn't move that fast - for example, Debian runs the cleanup step once a week which is perfectly fine. If you update hourly, this may become an issue though (if you also cleaned weekly, it would just be a less-noticeable issue). Unfortunately, this is one of those feature requests that isn't actually trivial to implement and will need quite a bit of work (likely the way of least resistance is adding another subdatabase storing timestamps, but keeping that in sync will be annoying too).