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:
Derrick Hammer 2024-03-14 07:40:12 -04:00
parent 37708c91f2
commit e380dacced
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 1 additions and 1 deletions

View File

@ -212,7 +212,7 @@ func (p PriceTracker) importPrices() error {
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)
dateKey := currentDate.Format("2006-01-02")
if _, exists := existingDateMap[dateKey]; !exists {