Solcast: avoid hitting rate limit (#18726)

This commit is contained in:
andig 2025-02-11 09:52:24 +01:00 • committed by GitHub
parent d8fa2b559a
commit 0a42b7a753
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -71,7 +71,8 @@ func NewSolcastFromConfig(other map[string]interface{}) (api.Tariff, error) {
func (t *Solcast) run(done chan error) {
var once sync.Once
for ; true; <-time.Tick(time.Hour) {
// don't exceed 10 requests per 24h
for ; true; <-time.Tick(time.Duration(3*len(t.sites)) * time.Hour) {
var res solcast.Forecasts
if err := backoff.Retry(func() error {