Unfreeze models in RecordDataCountsWorker (#15419)

This commit is contained in:
Mac Siri 2021-11-18 11:30:40 -05:00 committed by GitHub
parent 9f084b635c
commit ef83f0b07b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,21 +3,10 @@ module Metrics
include Sidekiq::Worker
sidekiq_options queue: :low_priority, retry: 10
MODELS = [
Article,
Comment,
Listing,
Notification,
Organization,
PageView,
Podcast,
PodcastEpisode,
Profile,
User,
].freeze
def perform
MODELS.each do |model|
models = [User, Article, Organization, Comment, Podcast, PodcastEpisode, Listing, PageView, Notification,
Profile]
models.each do |model|
db_count = begin
model.count
rescue ActiveRecord::QueryCanceled