nix-community / nix-vscode-extensions

Nix expressions for VSCode and OpenVSX extensions [maintainers: @deemp, @AmeerTaweel]
MIT License
194 stars 11 forks source link

Improve discarding strategy #17

Closed deemp closed 1 year ago

deemp commented 1 year ago

We discard the extensions based on a single request. It may be better to discard them when they're unavailable multiple times.

What we do now:

  1. Each run, we get a list of extensions from API.
  2. We look at the extensions that aren't present in our json and fetch them.
  3. We discard from that json the extensions that aren't present in the API response.
  4. We add the new extensions into json.

How we can improve discarding:

    • [ ] Add a field unavailable_count to an extension info. It will record how many times the extension was unavailable.
    • [ ] If an extension reaches some threshold, it is discarded.
    • [ ] When it's present in a next API response, its counter will be set to 0.