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

Cache results, to prevent rate limiting #3

Open
DarthHater opened this issue Mar 14, 2019 · 2 comments
Open

Cache results, to prevent rate limiting #3

DarthHater opened this issue Mar 14, 2019 · 2 comments
Labels
enhancement New feature or request hacktoberfest help wanted Extra attention is needed
Milestone

Comments

@DarthHater
Copy link
Member

DarthHater commented Mar 14, 2019

Thanks for creating an issue! Please fill out this form so we can be
sure to have all the information we need, and to minimize back and forth.

  • What are you trying to do?

Similar to nancy, you can cache the results of reaching out to OSSIndex, to prevent rate limiting. These results should be cached for 12 hours, and then removed from the cache if that TTL has expired.

  • What feature or behavior is this required for?

It will hopefully help people avoid hitting rate limits.

  • How could we solve this issue? (Not knowing is okay!)

@jdillon can likely share some info on this, there's a generic implementation for what Jason did with our Java tooling, this can likely follow that.

At a minimum your API probably needs:

  • Ability to clean the cache (and a new flag for the cli to let someone do this)
  • An ability to insert an item into the cache (will likely check if it exists before inserting)
  • An ability to get from the cache (will error if item is expired, so someone knows to update it)

Likely it would be nice to make the TTL configurable, but the default should be 12 hours.

The cache should be saved at ~/.ossindex/cargo-pants so that it's in a common location.

  • Anything else?

Potentially look at: https://docs.rs/pickledb/0.4.1/pickledb/ or https://docs.rs/tinydb/0.0.7/tinydb/

@MichelKazi
Copy link

The most i know about rust so far is how to print a hello world haha but if this isn't being done atm I'd like to try it out

@DarthHater
Copy link
Member Author

@DarthHater DarthHater added this to the 0.2 milestone Aug 14, 2020
@DarthHater DarthHater added enhancement New feature or request help wanted Extra attention is needed labels Aug 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hacktoberfest help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants