add configuration for monthly aggregation job timing
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2026-01-28 09:04:16 +11:00
parent ee01d8deac
commit c566456ebd
3 changed files with 6 additions and 1 deletions

View File

@@ -48,6 +48,7 @@ type SettingsYML struct {
DailyJobTimeoutSeconds int `yaml:"daily_job_timeout_seconds"` DailyJobTimeoutSeconds int `yaml:"daily_job_timeout_seconds"`
MonthlyJobTimeoutSeconds int `yaml:"monthly_job_timeout_seconds"` MonthlyJobTimeoutSeconds int `yaml:"monthly_job_timeout_seconds"`
MonthlyAggregationGranularity string `yaml:"monthly_aggregation_granularity"` MonthlyAggregationGranularity string `yaml:"monthly_aggregation_granularity"`
MonthlyAggregationCron string `yaml:"monthly_aggregation_cron"`
CleanupJobTimeoutSeconds int `yaml:"cleanup_job_timeout_seconds"` CleanupJobTimeoutSeconds int `yaml:"cleanup_job_timeout_seconds"`
TenantsToFilter []string `yaml:"tenants_to_filter"` TenantsToFilter []string `yaml:"tenants_to_filter"`
NodeChargeClusters []string `yaml:"node_charge_clusters"` NodeChargeClusters []string `yaml:"node_charge_clusters"`

View File

@@ -228,7 +228,10 @@ func main() {
} }
logger.Debug("Created vcenter inventory aggregation cron job", "job", job4.ID(), "starting_at", startsAt4) 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) logger.Debug("Setting monthly aggregation cron schedule", "cron", monthlyCron)
job5, err := c.NewJob( job5, err := c.NewJob(
gocron.CronJob(monthlyCron, false), gocron.CronJob(monthlyCron, false),

View File

@@ -27,6 +27,7 @@ settings:
daily_job_timeout_seconds: 900 daily_job_timeout_seconds: 900
monthly_job_timeout_seconds: 1200 monthly_job_timeout_seconds: 1200
monthly_aggregation_granularity: "hourly" monthly_aggregation_granularity: "hourly"
monthly_aggregation_cron: "10 3 1 * *"
cleanup_job_timeout_seconds: 600 cleanup_job_timeout_seconds: 600
tenants_to_filter: tenants_to_filter:
node_charge_clusters: node_charge_clusters: