FIX: Handle missing redis when collecting mini_scheduler metrics

FIX: Handle missing redis when collecting mini_scheduler metrics

diff --git a/lib/internal_metric/global.rb b/lib/internal_metric/global.rb
index 571e38f..f542368 100644
--- a/lib/internal_metric/global.rb
+++ b/lib/internal_metric/global.rb
@@ -245,6 +245,8 @@ module DiscoursePrometheus::InternalMetric
         stats[labels] += 1
       end
       stats
+    rescue => e
+      Discourse.warn_exception(e, message: "Failed to connect to redis to collect scheduled job status")
     end
 
     def find_stuck_sidekiq_jobs

GitHub sha: 4c198ec5

1 Like