Sha256: 5f33f3bebbba1280dde14aaab0d7392ad96206ff94bc31bc525620f487bf0e1b

Contents?: true

Size: 687 Bytes

Versions: 28

Compression:

Stored size: 687 Bytes

Contents

module Workarea
  class ProcessImport
    include Sidekiq::Worker
    include Sidekiq::CallbacksWorker
    include Sidekiq::Throttled::Worker

    sidekiq_options(
      enqueue_on: { DataFile::Import => :create },
      queue: 'low',
      retry: false
    )

    sidekiq_throttle(concurrency: { limit: 1 })

    def perform(id)
      import = DataFile::Import.find(id)
      import.process!

    ensure
      if import&.error?
        Admin::DataFileMailer.import_error(id).deliver_now
      elsif import&.failure?
        Admin::DataFileMailer.import_failure(id).deliver_now
      elsif import.present?
        Admin::DataFileMailer.import(id).deliver_now
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
workarea-core-3.5.27 app/workers/workarea/process_import.rb
workarea-core-3.5.26 app/workers/workarea/process_import.rb
workarea-core-3.4.45 app/workers/workarea/process_import.rb
workarea-core-3.5.25 app/workers/workarea/process_import.rb
workarea-core-3.5.23 app/workers/workarea/process_import.rb
workarea-core-3.4.44 app/workers/workarea/process_import.rb
workarea-core-3.5.22 app/workers/workarea/process_import.rb
workarea-core-3.4.43 app/workers/workarea/process_import.rb
workarea-core-3.5.21 app/workers/workarea/process_import.rb
workarea-core-3.4.42 app/workers/workarea/process_import.rb
workarea-core-3.5.20 app/workers/workarea/process_import.rb
workarea-core-3.4.41 app/workers/workarea/process_import.rb
workarea-core-3.5.19 app/workers/workarea/process_import.rb
workarea-core-3.4.40 app/workers/workarea/process_import.rb
workarea-core-3.5.18 app/workers/workarea/process_import.rb
workarea-core-3.4.39 app/workers/workarea/process_import.rb
workarea-core-3.5.17 app/workers/workarea/process_import.rb
workarea-core-3.4.38 app/workers/workarea/process_import.rb
workarea-core-3.5.16 app/workers/workarea/process_import.rb
workarea-core-3.4.37 app/workers/workarea/process_import.rb