Skip to content

Commit

Permalink
Solcast: avoid hitting rate limit (#18726)
Browse files Browse the repository at this point in the history
  • Loading branch information
andig authored Feb 11, 2025
1 parent d8fa2b5 commit 0a42b7a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tariff/solcast.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 0a42b7a

Please sign in to comment.