Count RfCs with comments in PostgreSQL for faster Prometheus initialization

This commit is contained in:
Sebastian Serth
2021-04-19 14:55:47 +02:00
parent 521a0cb710
commit 6bd9ae9c80

View File

@ -41,7 +41,7 @@ module Prometheus
state: RequestForComment::SOLVED) state: RequestForComment::SOLVED)
# count of rfcs with comments # count of rfcs with comments
@rfc_commented_count.observe(RequestForComment.with_comments.count) @rfc_commented_count.observe(RequestForComment.joins(:comments).distinct.count(:id))
end end
def update_notification(object) def update_notification(object)