Periodically remove expired PuSH subscribers (#4654)
This commit is contained in:
parent
143b77e10d
commit
f391a4673a
6 changed files with 15 additions and 4 deletions
|
@ -5,8 +5,6 @@ class Scheduler::FeedCleanupScheduler
|
|||
include Sidekiq::Worker
|
||||
|
||||
def perform
|
||||
logger.info 'Cleaning out home feeds of inactive users'
|
||||
|
||||
redis.pipelined do
|
||||
inactive_users.pluck(:account_id).each do |account_id|
|
||||
redis.del(FeedManager.instance.key(:home, account_id))
|
||||
|
|
|
@ -5,7 +5,6 @@ class Scheduler::MediaCleanupScheduler
|
|||
include Sidekiq::Worker
|
||||
|
||||
def perform
|
||||
logger.info 'Cleaning out unattached media attachments'
|
||||
unattached_media.find_each(&:destroy)
|
||||
end
|
||||
|
||||
|
|
11
app/workers/scheduler/subscriptions_cleanup_scheduler.rb
Normal file
11
app/workers/scheduler/subscriptions_cleanup_scheduler.rb
Normal file
|
@ -0,0 +1,11 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'sidekiq-scheduler'
|
||||
|
||||
class Scheduler::SubscriptionsCleanupScheduler
|
||||
include Sidekiq::Worker
|
||||
|
||||
def perform
|
||||
Subscription.expired.in_batches.delete_all
|
||||
end
|
||||
end
|
|
@ -7,7 +7,6 @@ class Scheduler::SubscriptionsScheduler
|
|||
include Sidekiq::Worker
|
||||
|
||||
def perform
|
||||
logger.info 'Queueing PuSH re-subscriptions'
|
||||
Pubsubhubbub::SubscribeWorker.push_bulk(expiring_accounts.pluck(:id))
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue