mirror of
https://github.com/glitch-soc/mastodon.git
synced 2024-11-24 17:14:15 -05:00
25 lines
417 B
Ruby
25 lines
417 B
Ruby
# frozen_string_literal: true
|
|
require 'sidekiq-scheduler'
|
|
|
|
class Scheduler::FeedCleanupScheduler
|
|
include Sidekiq::Worker
|
|
|
|
def perform
|
|
redis.pipelined do
|
|
inactive_users.pluck(:account_id).each do |account_id|
|
|
redis.del(FeedManager.instance.key(:home, account_id))
|
|
end
|
|
end
|
|
end
|
|
|
|
private
|
|
|
|
def inactive_users
|
|
User.confirmed.inactive
|
|
end
|
|
|
|
def redis
|
|
Redis.current
|
|
end
|
|
end
|