tag_unmerge_worker.rb 473 B

123456789101112131415161718192021
  1. # frozen_string_literal: true
  2. class TagUnmergeWorker
  3. include Sidekiq::Worker
  4. include DatabaseHelper
  5. sidekiq_options queue: 'pull'
  6. def perform(from_tag_id, into_account_id)
  7. with_primary do
  8. @from_tag = Tag.find(from_tag_id)
  9. @into_account = Account.find(into_account_id)
  10. end
  11. with_read_replica do
  12. FeedManager.instance.unmerge_tag_from_home(@from_tag, @into_account)
  13. end
  14. rescue ActiveRecord::RecordNotFound
  15. true
  16. end
  17. end