From 32517b4e41002ee536d24d29dda6552a02766a4e Mon Sep 17 00:00:00 2001 From: "Alexander \"PapaTutuWawa" Date: Mon, 8 Jan 2024 22:53:01 +0100 Subject: [PATCH] fix: I forgot to start the scheduler... --- main.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index 3cbfa6b..3e0f3ae 100644 --- a/main.go +++ b/main.go @@ -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,