Selaa lähdekoodia

fix timezone, use UTC instead of system tz

Signed-off-by: r2k1 <yokree@gmail.com>
r2k1 3 vuotta sitten
vanhempi
sitoutus
9496b797ff
1 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. 2 2
      pkg/costmodel/csv_export.go

+ 2 - 2
pkg/costmodel/csv_export.go

@@ -45,10 +45,10 @@ func UpdateCSVWorker(ctx context.Context, storage CloudStorage, model Allocation
 				// it's background worker, log error and carry on, maybe next time it will work
 				// it's background worker, log error and carry on, maybe next time it will work
 				log.Errorf("Error updating CSV: %s", err)
 				log.Errorf("Error updating CSV: %s", err)
 			}
 			}
-			now := time.Now()
+			now := time.Now().UTC()
 			// next launch is at 00:10 UTC tomorrow
 			// next launch is at 00:10 UTC tomorrow
 			// extra 10 minutes is to let prometheus to collect all the data for the previous day
 			// extra 10 minutes is to let prometheus to collect all the data for the previous day
-			nextRunAt = time.Date(now.Year(), now.Month(), now.Day(), 0, 10, 0, 0, time.UTC).AddDate(0, 0, 1)
+			nextRunAt = time.Date(now.Year(), now.Month(), now.Day(), 0, 10, 0, 0, now.Location()).AddDate(0, 0, 1)
 		}
 		}
 	}
 	}
 }
 }