1
0

mute_worker.rb 503 B

1234567891011121314151617181920
  1. # frozen_string_literal: true
  2. class MuteWorker
  3. include Sidekiq::Worker
  4. include DatabaseHelper
  5. def perform(account_id, target_account_id)
  6. with_primary do
  7. @account = Account.find(account_id)
  8. @target_account = Account.find(target_account_id)
  9. end
  10. with_read_replica do
  11. FeedManager.instance.clear_from_home(@account, @target_account)
  12. FeedManager.instance.clear_from_lists(@account, @target_account)
  13. end
  14. rescue ActiveRecord::RecordNotFound
  15. true
  16. end
  17. end