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

cooldown before repopulating the cache #454

Open
teto opened this issue Jul 3, 2024 · 1 comment
Open

cooldown before repopulating the cache #454

teto opened this issue Jul 3, 2024 · 1 comment

Comments

@teto
Copy link
Member

teto commented Jul 3, 2024

seems like rocks.nvim fetches several manifests on each startup. Now I am sometimes on a laptop with limited battery/connectivity and I think it's too much. Even on desktop.

There is a related setting: {lazy?} (boolean) Whether to query luarocks.org lazily. but I think it might be worth introducing some complexity to avoid the current dilemna between "wasteful" or "too late".

One proposition is to rename the vague lazy setting to something more precise, e.g., plugin_listing_cache_strategy and accept a string instead of a boolean (or enum or integer) to be able to:

  • disable it ? not sure why someone would want that, to reduce the risks of non-significant failures maybe. like in Luarocks fails to resolve manifest #329
  • keep the "lazy" (maybe rename it to "on-demand" ?)
  • "on-startup" (the current lazy=false)
  • some way to set a timeout after which the cache should be asked again.

I also wondered if there was already a command to refresh the cache ? Maybe it's not important as it's just used for autocompletion and we can try installing a plugin not present in the cached manifest ?

@mrcjkb
Copy link
Member

mrcjkb commented Jul 8, 2024

some way to set a timeout after which the cache should be asked again.

We could do what rocks does, which is:

  • store the cached manifest locally
  • query luarocks.org for the date the manifest was last modified with a HEAD request
  • Compare timestamps and update as needed.

But this should be implemented in luarocks, not rocks.nvim.

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

No branches or pull requests

2 participants