Sha256: 7a7e107dcd6f2419be0a6fcfbae4001052a13211c28c1423df17dbfc54326c49

Contents?: true

Size: 668 Bytes

Versions: 34

Compression:

Stored size: 668 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
      else
        Admin::DataFileMailer.import(id).deliver_now
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
workarea-core-3.5.11 app/workers/workarea/process_import.rb
workarea-core-3.5.10 app/workers/workarea/process_import.rb
workarea-core-3.4.32 app/workers/workarea/process_import.rb
workarea-core-3.5.9 app/workers/workarea/process_import.rb
workarea-core-3.4.31 app/workers/workarea/process_import.rb
workarea-core-3.5.8 app/workers/workarea/process_import.rb
workarea-core-3.4.30 app/workers/workarea/process_import.rb
workarea-core-3.5.7 app/workers/workarea/process_import.rb
workarea-core-3.4.29 app/workers/workarea/process_import.rb
workarea-core-3.5.6 app/workers/workarea/process_import.rb
workarea-core-3.4.28 app/workers/workarea/process_import.rb
workarea-core-3.5.5 app/workers/workarea/process_import.rb
workarea-core-3.4.27 app/workers/workarea/process_import.rb
workarea-core-3.5.4 app/workers/workarea/process_import.rb
workarea-core-3.4.26 app/workers/workarea/process_import.rb
workarea-core-3.5.3 app/workers/workarea/process_import.rb
workarea-core-3.4.25 app/workers/workarea/process_import.rb
workarea-core-3.5.2 app/workers/workarea/process_import.rb
workarea-core-3.4.24 app/workers/workarea/process_import.rb
workarea-core-3.5.1 app/workers/workarea/process_import.rb