From b32da4010c5a5cb4c1a7ec80cb0d83bf7b9063ef Mon Sep 17 00:00:00 2001 From: Simon Roberts Date: Thu, 26 Aug 2021 09:44:11 +1000 Subject: [PATCH] Include currencyConversion in the cache key so changing currencies invalidates the cache. See https://github.com/miguelmota/cointop/issues/144 --- cointop/chart.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cointop/chart.go b/cointop/chart.go index ecade65..363afed 100644 --- a/cointop/chart.go +++ b/cointop/chart.go @@ -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