Adding backtracing to Salmon/Processing workers

signup-info-prompt
Eugen Rochko 2016-11-28 19:11:36 +01:00
parent 27fc49d745
commit 4eba76711b
4 changed files with 5 additions and 1 deletions

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true # frozen_string_literal: true
class Subscription < ApplicationRecord class Subscription < ApplicationRecord
MIN_EXPIRATION = 3600 * 24 MIN_EXPIRATION = 3600 * 24 * 7
MAX_EXPIRATION = 3600 * 24 * 30 MAX_EXPIRATION = 3600 * 24 * 30
belongs_to :account belongs_to :account

View File

@ -5,6 +5,8 @@ class UpdateRemoteProfileService < BaseService
DFRN_NS = 'http://purl.org/macgirvin/dfrn/1.0' DFRN_NS = 'http://purl.org/macgirvin/dfrn/1.0'
def call(xml, account, resubscribe = false) def call(xml, account, resubscribe = false)
return if xml.nil?
author_xml = xml.at_xpath('./xmlns:author') || xml.at_xpath('./dfrn:owner', dfrn: DFRN_NS) author_xml = xml.at_xpath('./xmlns:author') || xml.at_xpath('./dfrn:owner', dfrn: DFRN_NS)
hub_link = xml.at_xpath('./xmlns:link[@rel="hub"]') hub_link = xml.at_xpath('./xmlns:link[@rel="hub"]')

View File

@ -2,6 +2,7 @@
class ProcessingWorker class ProcessingWorker
include Sidekiq::Worker include Sidekiq::Worker
sidekiq_options backtrace: true
def perform(account_id, body) def perform(account_id, body)
ProcessFeedService.new.call(body, Account.find(account_id)) ProcessFeedService.new.call(body, Account.find(account_id))

View File

@ -2,6 +2,7 @@
class SalmonWorker class SalmonWorker
include Sidekiq::Worker include Sidekiq::Worker
sidekiq_options backtrace: true
def perform(account_id, body) def perform(account_id, body)
ProcessInteractionService.new.call(body, Account.find(account_id)) ProcessInteractionService.new.call(body, Account.find(account_id))