mastodon/app/workers/account_merging_worker.rb
2025-09-03 15:58:08 -04:00

19 lines
394 B
Ruby

# frozen_string_literal: true
class AccountMergingWorker
include Sidekiq::Worker
sidekiq_options queue: 'pull'
def perform(account_id)
account = Account.find(account_id)
return true if account.nil? || account.local?
Account.where(uri: account.uri).excluding(account).find_each do |duplicate|
account.merge_with!(duplicate)
duplicate.destroy
end
end
end