mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-22 14:15:22 +00:00
21 lines
503 B
Ruby
21 lines
503 B
Ruby
# frozen_string_literal: true
|
|
|
|
class MuteWorker
|
|
include Sidekiq::Worker
|
|
include DatabaseHelper
|
|
|
|
def perform(account_id, target_account_id)
|
|
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
|
|
rescue ActiveRecord::RecordNotFound
|
|
true
|
|
end
|
|
end
|