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

Write API usage cache on every successful poll #29

Merged
merged 6 commits into from
Jun 16, 2024

Conversation

autoSteve
Copy link
Collaborator

The number of API calls used is retrieved from Solcast on integration restart. If this fails (due to site busy), then the usage cache is relied on to know how many calls have been made for the day.

This cache is not being updated when successful calls to get solar forecast are made, so this pull fixes that.

Thanks for pointing this out, @gcoan. #12.

@autoSteve autoSteve added the bug Something isn't working label Jun 16, 2024
@autoSteve autoSteve requested a review from BJReplay as a code owner June 16, 2024 04:06
For a new install, should the API call to get usage and limit fail for the very first time then the cache will not yet be created.

Prior, the limit would have been zero, causing all sorts of issues. This sets the default to ten.
@autoSteve
Copy link
Collaborator Author

After further testing and reviewing #12, I have made some slight changes, @BJReplay. This squishes some bugs, so probably deserves a release.

@autoSteve autoSteve merged commit 211dba0 into v3 Jun 16, 2024
4 checks passed
Copy link
Owner

@BJReplay BJReplay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the release while I was out!

I will try to review in a timely manner because reviews are useful and can pick things up - but I do trust you!

@autoSteve
Copy link
Collaborator Author

Absolutely agree. This was a super simple one.

@autoSteve autoSteve deleted the API-counter-cache-write-on-forecast-200 branch June 16, 2024 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants