Fail to handle missing record when active job runs after the resource got delete
Closed this issue · 1 comments
nicolassocheleau commented
If ProcessAsset is queued with ActiveJob but the resource is deleted before the job can start, it raises an exception.
Below is a testcase to highlight the issue (spec/integrations/process_in_background_spec.rb)
it 'skip the resource when not found' do
admin.update(avatar: load_file('test-1.jpg'))
expect(admin.avatar_processing).to be(true)
admin.destroy
expect do
process_latest_sidekiq_job
end.not_to raise_exception
end
lardawge commented
This is not something I will support given it is not a common use case.
If there is something in your application that is causing this, you can follow the instructions in the readme and override the worker.