FIX: Make sure DiscoursePrometheus is installed when collecting metrics (#1107)

This commit is contained in:
Roman Rizzi 2025-02-03 11:04:25 -03:00 committed by GitHub
parent cf86d274a0
commit 7ad922331b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,6 +4,7 @@ module DiscourseAi
module AiModeration
class SpamMetric
def self.update(new_status, reviewable)
return if !defined?(::DiscoursePrometheus)
ai_spam_log = AiSpamLog.find_by(reviewable:)
return if ai_spam_log.nil?