Revert "Fix ProcessReferencesWorker error for tasks before update"
This reverts commit 75c0e512f4
.
This commit is contained in:
parent
41f4175e66
commit
097e7ac5d1
3 changed files with 4 additions and 21 deletions
|
@ -46,7 +46,7 @@ class ProcessReferencesService < BaseService
|
||||||
return unless need_process?(status, reference_parameters, urls)
|
return unless need_process?(status, reference_parameters, urls)
|
||||||
|
|
||||||
Rails.cache.write("status_reference:#{status.id}", true, expires_in: 10.minutes)
|
Rails.cache.write("status_reference:#{status.id}", true, expires_in: 10.minutes)
|
||||||
ProcessReferencesWorker.perform_async(status.id, reference_parameters, urls, no_fetch_urls: [])
|
ProcessReferencesWorker.perform_async(status.id, reference_parameters, urls, [])
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.call_service(status, reference_parameters, urls)
|
def self.call_service(status, reference_parameters, urls)
|
||||||
|
@ -133,6 +133,6 @@ class ProcessReferencesService < BaseService
|
||||||
end
|
end
|
||||||
|
|
||||||
def launch_worker
|
def launch_worker
|
||||||
ProcessReferencesWorker.perform_async(@status.id, @reference_parameters, @urls, no_fetch_urls: @no_fetch_urls)
|
ProcessReferencesWorker.perform_async(@status.id, @reference_parameters, @urls, @no_fetch_urls)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
class ProcessReferencesWorker
|
class ProcessReferencesWorker
|
||||||
include Sidekiq::Worker
|
include Sidekiq::Worker
|
||||||
|
|
||||||
def perform(status_id, ids, urls, no_fetch_urls: nil)
|
def perform(status_id, ids, urls, no_fetch_urls)
|
||||||
ProcessReferencesService.new.call(Status.find(status_id), ids || [], urls: urls || [], no_fetch_urls: no_fetch_urls || [])
|
ProcessReferencesService.new.call(Status.find(status_id), ids || [], urls: urls || [], no_fetch_urls: no_fetch_urls)
|
||||||
rescue ActiveRecord::RecordNotFound
|
rescue ActiveRecord::RecordNotFound
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,17 +0,0 @@
|
||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
require 'rails_helper'
|
|
||||||
|
|
||||||
describe ProcessReferencesWorker do
|
|
||||||
let(:worker) { described_class.new }
|
|
||||||
|
|
||||||
describe 'perform' do
|
|
||||||
it 'runs without error for simple call' do
|
|
||||||
expect { worker.perform(1000, [], []) }.to_not raise_error
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'runs without error with no_fetch_urls' do
|
|
||||||
expect { worker.perform(1000, [], [], no_fetch_urls: []) }.to_not raise_error
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
Loading…
Add table
Add a link
Reference in a new issue