Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gy2411 committed Nov 14, 2024
1 parent 085a114 commit f415a46
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions cloud/tasks/register_system_tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,20 @@ func RegisterSystemTasks(
return err
}

collectListerMetricsTaskScheduleInterval, err := time.ParseDuration(
config.GetCollectListerMetricsTaskScheduleInterval(),
)
if err != nil {
return err
}

err = registry.RegisterForExecution(
"tasks.CollectListerMetrics", func() Task {
return &collectListerMetricsTask{
registry: tasksMetricsRegistry,
storage: storage,
metricsCollectionInterval: listerMetricsCollectionInterval,

// This task is registered in control plane and collects metrics
// for all types of tasks.
taskTypes: registry.TaskTypes(),
hangingTaskGaugesByID: make(map[string]metrics.Gauge),
maxHangingTaskIDsToReport: config.GetMaxHangingTaskIDsToReport(),
Expand All @@ -87,13 +92,6 @@ func RegisterSystemTasks(
return err
}

collectListerMetricsTaskScheduleInterval, err := time.ParseDuration(
config.GetCollectListerMetricsTaskScheduleInterval(),
)
if err != nil {
return err
}

taskScheduler.ScheduleRegularTasks(
ctx,
"tasks.CollectListerMetrics",
Expand Down

0 comments on commit f415a46

Please sign in to comment.