From 0a42b7a753ce7a0df2859802c279106f2201d03e Mon Sep 17 00:00:00 2001 From: andig Date: Tue, 11 Feb 2025 09:52:24 +0100 Subject: [PATCH] Solcast: avoid hitting rate limit (#18726) --- tariff/solcast.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tariff/solcast.go b/tariff/solcast.go index fb8d582800..2278ed0b57 100644 --- a/tariff/solcast.go +++ b/tariff/solcast.go @@ -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 {