diff --git a/internal/settings/settings.go b/internal/settings/settings.go index 8d52736..22ee4b0 100644 --- a/internal/settings/settings.go +++ b/internal/settings/settings.go @@ -48,6 +48,7 @@ type SettingsYML struct { DailyJobTimeoutSeconds int `yaml:"daily_job_timeout_seconds"` MonthlyJobTimeoutSeconds int `yaml:"monthly_job_timeout_seconds"` MonthlyAggregationGranularity string `yaml:"monthly_aggregation_granularity"` + MonthlyAggregationCron string `yaml:"monthly_aggregation_cron"` CleanupJobTimeoutSeconds int `yaml:"cleanup_job_timeout_seconds"` TenantsToFilter []string `yaml:"tenants_to_filter"` NodeChargeClusters []string `yaml:"node_charge_clusters"` diff --git a/main.go b/main.go index d69f43c..1a5abf1 100644 --- a/main.go +++ b/main.go @@ -228,7 +228,10 @@ func main() { } logger.Debug("Created vcenter inventory aggregation cron job", "job", job4.ID(), "starting_at", startsAt4) - monthlyCron := "0 0 1 * *" + monthlyCron := strings.TrimSpace(s.Values.Settings.MonthlyAggregationCron) + if monthlyCron == "" { + monthlyCron = "10 3 1 * *" + } logger.Debug("Setting monthly aggregation cron schedule", "cron", monthlyCron) job5, err := c.NewJob( gocron.CronJob(monthlyCron, false), diff --git a/src/vctp.yml b/src/vctp.yml index 202a135..926b533 100644 --- a/src/vctp.yml +++ b/src/vctp.yml @@ -27,6 +27,7 @@ settings: daily_job_timeout_seconds: 900 monthly_job_timeout_seconds: 1200 monthly_aggregation_granularity: "hourly" + monthly_aggregation_cron: "10 3 1 * *" cleanup_job_timeout_seconds: 600 tenants_to_filter: node_charge_clusters: