2018-10-07 21:44:58 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class MuteWorker
|
|
|
|
include Sidekiq::Worker
|
2024-11-19 10:04:12 +00:00
|
|
|
include DatabaseHelper
|
2018-10-07 21:44:58 +00:00
|
|
|
|
|
|
|
def perform(account_id, target_account_id)
|
2024-11-19 10:04:12 +00:00
|
|
|
with_primary do
|
|
|
|
@account = Account.find(account_id)
|
|
|
|
@target_account = Account.find(target_account_id)
|
|
|
|
end
|
|
|
|
|
|
|
|
with_read_replica do
|
|
|
|
FeedManager.instance.clear_from_home(@account, @target_account)
|
|
|
|
FeedManager.instance.clear_from_lists(@account, @target_account)
|
|
|
|
end
|
2020-09-08 01:41:16 +00:00
|
|
|
rescue ActiveRecord::RecordNotFound
|
|
|
|
true
|
2018-10-07 21:44:58 +00:00
|
|
|
end
|
|
|
|
end
|