about summary refs log tree commit diff
path: root/app/workers/pubsubhubbub/unsubscribe_worker.rb
blob: a271715b7a0e2bfb0796c6e2feaf01a51466acc6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# frozen_string_literal: true

class Pubsubhubbub::UnsubscribeWorker
  include Sidekiq::Worker

  sidekiq_options queue: 'push', retry: false, unique: :until_executed, dead: false

  def perform(account_id)
    account = Account.find(account_id)
    logger.debug "PuSH unsubscribing from #{account.acct}"
    ::UnsubscribeService.new.call(account)
  rescue ActiveRecord::RecordNotFound
    true
  end
end