Include currencyConversion in the cache key so changing currencies invalidates the cache. See https://github.com/miguelmota/cointop/issues/144

pull/143/head
Simon Roberts 3 years ago
parent e7d32f18fc
commit b32da4010c

@ -218,7 +218,7 @@ func (ct *Cointop) PortfolioChart() error {
}
var graphData []float64
cachekey := strings.ToLower(fmt.Sprintf("%s_%s", p.Symbol, strings.Replace(selectedChartRange, " ", "", -1)))
cachekey := strings.ToLower(fmt.Sprintf("%s_%s_%s", p.Symbol, convert, strings.Replace(selectedChartRange, " ", "", -1)))
cached, found := ct.cache.Get(cachekey)
if found {
// cache hit

Loading…
Cancel
Save