assemblymade/coderwall

View on GitHub
app/jobs/protips_recalculate_scores_job.rb

Summary

Maintainability
A
0 mins
Test Coverage
class ProtipsRecalculateScoresJob
  include Sidekiq::Worker

  sidekiq_options queue: :protip

  def perform
    Protip.where('created_at > ?', 25.hours.ago).where(upvotes_value_cache: nil).each do |protip|
      ProcessProtipJob.perform_async(:recalculate_score, protip.id)
    end
  end
end