This commit is contained in:
@@ -24,7 +24,8 @@ func (c *CronTask) RunVcenterDailyAggregate(ctx context.Context, logger *slog.Lo
|
|||||||
defer func() {
|
defer func() {
|
||||||
logger.Info("Daily summary job finished", "duration", time.Since(startedAt))
|
logger.Info("Daily summary job finished", "duration", time.Since(startedAt))
|
||||||
}()
|
}()
|
||||||
targetTime := time.Now().Add(-time.Minute)
|
// Aggregate the previous day to avoid partial "today" data when the job runs just after midnight.
|
||||||
|
targetTime := time.Now().AddDate(0, 0, -1)
|
||||||
// Always force regeneration on the scheduled run to refresh data even if a manual run happened earlier.
|
// Always force regeneration on the scheduled run to refresh data even if a manual run happened earlier.
|
||||||
return c.aggregateDailySummary(jobCtx, targetTime, true)
|
return c.aggregateDailySummary(jobCtx, targetTime, true)
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user