Solcast: avoid hitting rate limit (#18726)
This commit is contained in:
parent
d8fa2b559a
commit
0a42b7a753
1 changed files with 2 additions and 1 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue