2018-10-07 23:44:58 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class MuteWorker
|
|
|
|
include Sidekiq::Worker
|
2024-11-19 11:04:12 +01:00
|
|
|
include DatabaseHelper
|
2018-10-07 23:44:58 +02:00
|
|
|
|
|
|
|
def perform(account_id, target_account_id)
|
2024-11-19 11:04:12 +01: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 03:41:16 +02:00
|
|
|
rescue ActiveRecord::RecordNotFound
|
|
|
|
true
|
2018-10-07 23:44:58 +02:00
|
|
|
end
|
|
|
|
end
|