Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleaning package cache based on access time #60

Open
nroi opened this issue Jun 6, 2021 · 4 comments
Open

Cleaning package cache based on access time #60

nroi opened this issue Jun 6, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@nroi
Copy link
Owner

nroi commented Jun 6, 2021

Flexo already provides the possibility to automatically clean the package cache by retaining not more than x versions. However, it can still happen that a package is downloaded once by a client, and then uninstalled by the client, so that the package now remains in the cache indefinitely even though no client needs it anymore.

paccache provides the -u, --uninstalled flag for this use case, but we cannot provide something similar for Flexo, because Flexo runs on a server, so it doesn't know which packages are installed by the various clients that are using Flexo.

As a workaround, we should give the user the possibility to define something like the following in the configuration file:

retain_for_duration = "9 months"

So that Flexo will remove all packages older than the given duration, even if that means that fewer than num_versions_retain versions are retained in the cache.

We are already using the humantime library to parse human-readable durations, so implementing this should be easy.

If this option is not defined in the configuration file, the default should be to not delete any packages based on the access time.

@nroi nroi added the enhancement New feature or request label Jun 6, 2021
@ivdimitro
Copy link

If you implement this option you can consider the auto refresh option after that. ;)

@nroi
Copy link
Owner Author

nroi commented Dec 18, 2021

If you implement this option you can consider the auto refresh option after that. ;)

What do you mean by "auto refresh option"?

@WTechNinja
Copy link

If I had to make a guess, I'm guessing they want an option for flexo to automatically download package updates every configurable amount of time (without installing them)

@nroi
Copy link
Owner Author

nroi commented Feb 21, 2022

If I had to make a guess, I'm guessing they want an option for flexo to automatically download package updates every configurable amount of time (without installing them)

I thought about that, and decided to not implement this for different reasons. One reason is that this would cause unnecessary traffic on the mirrors because some packages are updated much more often than they are installed. For example, if a package is updated from version 1 to 2 and then 3, Flexo might download all three versions, but pacman might upgrade from 1 to 3 without ever downloading version 2. This is wasteful and something that I want to avoid, especially since the mirrors are provided by volunteers.
Another reason is that Flexo does not know which packages are required by the client. Just because a package has been downloaded in the past does not mean that a newer version of this package will also be downloaded. The user might have installed the package, tried it out, and immediately decided to uninstall it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants