import_worker.rb 390 B

1234567891011121314151617
  1. # frozen_string_literal: true
  2. # NOTE: This is a deprecated worker, only kept to not break ongoing imports
  3. # on upgrade. See `ImportWorker` for its replacement.
  4. class ImportWorker
  5. include Sidekiq::Worker
  6. sidekiq_options queue: 'pull', retry: false
  7. def perform(import_id)
  8. import = Import.find(import_id)
  9. ImportService.new.call(import)
  10. ensure
  11. import&.destroy
  12. end
  13. end