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 codes from API, only fetch new ones after a certain amount of time #13

Open
trs opened this issue Mar 1, 2020 · 0 comments
Open
Labels
feature New features added good first issue Good for newcomers help wanted Extra attention is needed

Comments

@trs
Copy link
Owner

trs commented Mar 1, 2020

To help with server load from the API provided by shift.orcicorn.com, we should cache the available codes and only request new ones if the cache is old.

This occurs at 00:02, 06:02, 12:02 and 18:02 server-time ( New York, USA )


On redeem, we want to store the result. Time should probably be based on the meta.generated field. On the next redeem request, check if the current time in New York, USA is > 1 hour from the meta.generated. If it is, send the request. If not, use the cached codes.

@trs trs added good first issue Good for newcomers feature New features added labels Mar 1, 2020
@trs trs added the help wanted Extra attention is needed label Oct 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New features added good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant