add configuration for monthly aggregation job timing
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -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"`
|
||||
|
||||
5
main.go
5
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),
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user