fix: loop needs to start at 1 so it's not outside the history range, else it tries to always create a date on boot
This commit is contained in:
parent
37708c91f2
commit
e380dacced
|
@ -212,7 +212,7 @@ func (p PriceTracker) importPrices() error {
|
||||||
existingDateMap[d.Format("2006-01-02")] = true
|
existingDateMap[d.Format("2006-01-02")] = true
|
||||||
}
|
}
|
||||||
|
|
||||||
for i := 0; i < daysOfHistory; i++ {
|
for i := 1; i <= daysOfHistory; i++ {
|
||||||
currentDate := startDate.AddDate(0, 0, i)
|
currentDate := startDate.AddDate(0, 0, i)
|
||||||
dateKey := currentDate.Format("2006-01-02")
|
dateKey := currentDate.Format("2006-01-02")
|
||||||
if _, exists := existingDateMap[dateKey]; !exists {
|
if _, exists := existingDateMap[dateKey]; !exists {
|
||||||
|
|
Loading…
Reference in New Issue