From 8456f8d4cd0b9ef8a0a41aa153bdc21294e1c7eb Mon Sep 17 00:00:00 2001 From: wint3rmute Date: Thu, 20 Jul 2023 19:36:22 +0200 Subject: [PATCH] Move metrics handler registration together with the rest of handlers, into invidious.cr --- src/invidious.cr | 1 + src/invidious/routing.cr | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/invidious.cr b/src/invidious.cr index e0bd0101..66a93bab 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -170,6 +170,7 @@ end if CONFIG.statistics_enabled Invidious::Jobs.register Invidious::Jobs::StatisticsRefreshJob.new(PG_DB, SOFTWARE) + add_handler Metrics::METRICS_COLLECTOR end if (CONFIG.use_pubsub_feeds.is_a?(Bool) && CONFIG.use_pubsub_feeds.as(Bool)) || (CONFIG.use_pubsub_feeds.is_a?(Int32) && CONFIG.use_pubsub_feeds.as(Int32) > 0) diff --git a/src/invidious/routing.cr b/src/invidious/routing.cr index 47a2519d..27c3d199 100644 --- a/src/invidious/routing.cr +++ b/src/invidious/routing.cr @@ -311,7 +311,6 @@ module Invidious::Routing # Misc get "/api/v1/stats", {{namespace}}::Misc, :stats if CONFIG.statistics_enabled - add_handler Metrics::METRICS_COLLECTOR get "/api/v1/metrics", {{namespace}}::Misc, :metrics end get "/api/v1/playlists/:plid", {{namespace}}::Misc, :get_playlist