Skip to content

Commit b3ce222

Browse files
committed
[executor] fix lint issues
1 parent 1c2392c commit b3ce222

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

internal/worker/executor/metrics.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,19 @@ func newMetrics() *metrics {
2626
Namespace: "worker",
2727
Subsystem: "executor",
2828
Name: "active_tasks",
29+
Help: "Number of active tasks",
2930
}),
3031
taskResult: promauto.NewCounterVec(prometheus.CounterOpts{
3132
Namespace: "worker",
3233
Subsystem: "executor",
3334
Name: "task_result_total",
35+
Help: "Task result, labeled by task name and result",
3436
}, []string{"task", "result"}),
3537
taskDuration: promauto.NewHistogramVec(prometheus.HistogramOpts{
3638
Namespace: "worker",
3739
Subsystem: "executor",
3840
Name: "task_duration_seconds",
41+
Help: "Task duration in seconds",
3942
Buckets: []float64{.001, .005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10},
4043
}, []string{"task"}),
4144
}

internal/worker/executor/service.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ func (s *Service) Start() error {
6969
}
7070

7171
func (s *Service) runTask(ctx context.Context, task PeriodicTask) {
72+
//nolint:gosec // it's ok
7273
initialDelay := time.Duration(math.Floor(rand.Float64()*task.Interval().Seconds())) * time.Second
7374

7475
s.logger.Info("initial delay", zap.String("name", task.Name()), zap.Duration("delay", initialDelay))

0 commit comments

Comments
 (0)