You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
417 B

  1. # frozen_string_literal: true
  2. require 'sidekiq-scheduler'
  3. class Scheduler::FeedCleanupScheduler
  4. include Sidekiq::Worker
  5. def perform
  6. redis.pipelined do
  7. inactive_users.pluck(:account_id).each do |account_id|
  8. redis.del(FeedManager.instance.key(:home, account_id))
  9. end
  10. end
  11. end
  12. private
  13. def inactive_users
  14. User.confirmed.inactive
  15. end
  16. def redis
  17. Redis.current
  18. end
  19. end