fix: I forgot to start the scheduler...
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
PapaTutuWawa 2024-01-08 22:53:01 +01:00
parent 5321a86b2c
commit 32517b4e41

View File

@ -166,17 +166,17 @@ func run(ctx *cli.Context) error {
updateMetrics(&metrics, lastUpdatedMetric)
},
),
gocron.WithStartAt(gocron.WithStartImmediately()),
)
if err != nil {
log.Error("Failed to create periodic task")
return err
}
// Perform an initial run to populate the metrics
log.Info("Performing initial requests...")
updateMetrics(&metrics, lastUpdatedMetric)
log.Debug("Done")
// Start the scheduler
scheduler.Start()
// Handle HTTP requests
http.Handle(
"/metrics", promhttp.HandlerFor(
registry,