fix: I forgot to start the scheduler...
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
5321a86b2c
commit
32517b4e41
8
main.go
8
main.go
@ -166,17 +166,17 @@ func run(ctx *cli.Context) error {
|
|||||||
updateMetrics(&metrics, lastUpdatedMetric)
|
updateMetrics(&metrics, lastUpdatedMetric)
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
gocron.WithStartAt(gocron.WithStartImmediately()),
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("Failed to create periodic task")
|
log.Error("Failed to create periodic task")
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Perform an initial run to populate the metrics
|
// Start the scheduler
|
||||||
log.Info("Performing initial requests...")
|
scheduler.Start()
|
||||||
updateMetrics(&metrics, lastUpdatedMetric)
|
|
||||||
log.Debug("Done")
|
|
||||||
|
|
||||||
|
// Handle HTTP requests
|
||||||
http.Handle(
|
http.Handle(
|
||||||
"/metrics", promhttp.HandlerFor(
|
"/metrics", promhttp.HandlerFor(
|
||||||
registry,
|
registry,
|
||||||
|
Loading…
Reference in New Issue
Block a user