fix vcenter update task to avoid re-adding update records for previous updates
Some checks are pending
CI / Publish Docker (push) Blocked by required conditions
CI / Lint (push) Waiting to run
CI / Test (push) Waiting to run
CI / End-to-End (push) Waiting to run
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-10-14 12:02:31 +11:00
parent cc6601146a
commit 1ecdb10cf7
4 changed files with 126 additions and 21 deletions

View File

@@ -188,10 +188,10 @@ func main() {
logger.Error("failed to start event processing cron job", "error", err)
os.Exit(1)
}
logger.Debug("Created event processing cron job", "job", job.ID())
logger.Debug("Created event processing cron job", "job", job.ID(), "starting_at", startsAt)
// start background checks of vcenter inventory
startsAt2 := time.Now().Add(time.Second * 300)
startsAt2 := time.Now().Add(cronInvFrequency)
job2, err := c.NewJob(
gocron.DurationJob(cronInvFrequency),
gocron.NewTask(func() {
@@ -203,7 +203,7 @@ func main() {
logger.Error("failed to start vcenter inventory cron job", "error", err)
os.Exit(1)
}
logger.Debug("Created vcenter inventory cron job", "job", job2.ID())
logger.Debug("Created vcenter inventory cron job", "job", job2.ID(), "starting_at", startsAt2)
// start cron scheduler
c.Start()