re-apply minimum snapshot interval
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2026-01-21 14:17:40 +11:00
parent 32d4a352dc
commit 3cdf368bc4

View File

@@ -1125,8 +1125,8 @@ func (c *CronTask) compareWithPreviousSnapshot(
if prevTableName != "" {
moreMissing := c.markMissingFromPrevious(ctx, dbConn, prevTableName, url, startTime, presentSnapshots, presentByUuid, presentByName, inventoryByVmID, inventoryByUuid, inventoryByName)
missingCount += moreMissing
expectedSeconds := int64(c.Settings.Values.Settings.VcenterInventorySnapshotSeconds)
// Skip only if snapshots are much closer together than the configured cadence.
expectedSeconds := int64(c.Settings.Values.Settings.VcenterInventorySnapshotSeconds) / 2
// Skip only if snapshots are closer together than half the configured cadence
if SnapshotTooSoon(prevSnapshotTime, startTime.Unix(), expectedSeconds) {
c.Logger.Info("skipping new-VM detection because snapshots are too close together", "prev_table", prevTableName, "prev_snapshot_unix", prevSnapshotTime, "current_snapshot_unix", startTime.Unix(), "expected_interval_seconds", expectedSeconds)
} else {