code re-org and bugfix hanging hourly snapshot
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2026-01-21 09:12:25 +11:00
parent c7c7fd3dc9
commit fd9cc185ce
6 changed files with 113 additions and 56 deletions

View File

@@ -185,7 +185,7 @@ func main() {
// One-shot mode: run a single inventory snapshot across all configured vCenters and exit.
if *runInventory {
logger.Info("Running one-shot inventory snapshot across all vCenters")
ct.RunVcenterSnapshotHourly(ctx, logger)
ct.RunVcenterSnapshotHourly(ctx, logger, true)
logger.Info("One-shot inventory snapshot complete; exiting")
return
}
@@ -200,7 +200,7 @@ func main() {
job3, err := c.NewJob(
gocron.DurationJob(cronSnapshotFrequency),
gocron.NewTask(func() {
ct.RunVcenterSnapshotHourly(ctx, logger)
ct.RunVcenterSnapshotHourly(ctx, logger, false)
}), gocron.WithSingletonMode(gocron.LimitModeReschedule),
gocron.WithStartAt(gocron.WithStartDateTime(startsAt3)),
)