Unfreeze models in RecordDataCountsWorker (#15419)
This commit is contained in:
parent
9f084b635c
commit
ef83f0b07b
1 changed files with 3 additions and 14 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue