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) 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,