implement rudimentary caching for yahoo finance to avoid http 429 rate limiting
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
15
providers/staticjsonYahooFinance/cache.go
Normal file
15
providers/staticjsonYahooFinance/cache.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package staticjsonYahooFinance
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const cacheAgeSeconds = 900
|
||||
|
||||
// intialized in providerImpl.go's Configure
|
||||
var chartCache map[string]chartCacheEntry
|
||||
|
||||
type chartCacheEntry struct {
|
||||
Chart chartResponse
|
||||
LastUpdated time.Time
|
||||
}
|
Reference in New Issue
Block a user