Sha256: 647f2c59661c4ac9e248e8811a062c2739a1f91e406d9975255bbf5796179afc

Contents?: true

Size: 502 Bytes

Versions: 62

Compression:

Stored size: 502 Bytes

Contents

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

    sidekiq_options(enqueue_on: { Reports::Export => :create }, queue: 'low')
    sidekiq_throttle(concurrency: { limit: 1 })

    def perform(id)
      export = Reports::Export.find(id)

      export.process! do |csv|
        ExportReport.new(export.report, csv).perform!
      end

      Admin::ReportsMailer.export(id).deliver_now
    end
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
workarea-core-3.4.27 app/workers/workarea/process_reports_export.rb
workarea-core-3.5.4 app/workers/workarea/process_reports_export.rb
workarea-core-3.4.26 app/workers/workarea/process_reports_export.rb
workarea-core-3.5.3 app/workers/workarea/process_reports_export.rb
workarea-core-3.4.25 app/workers/workarea/process_reports_export.rb
workarea-core-3.5.2 app/workers/workarea/process_reports_export.rb
workarea-core-3.4.24 app/workers/workarea/process_reports_export.rb
workarea-core-3.5.1 app/workers/workarea/process_reports_export.rb
workarea-core-3.4.23 app/workers/workarea/process_reports_export.rb
workarea-core-3.4.22 app/workers/workarea/process_reports_export.rb
workarea-core-3.5.0 app/workers/workarea/process_reports_export.rb
workarea-core-3.4.21 app/workers/workarea/process_reports_export.rb
workarea-core-3.5.0.beta.1 app/workers/workarea/process_reports_export.rb
workarea-core-3.4.20 app/workers/workarea/process_reports_export.rb
workarea-core-3.4.19 app/workers/workarea/process_reports_export.rb
workarea-core-3.4.18 app/workers/workarea/process_reports_export.rb
workarea-core-3.4.17 app/workers/workarea/process_reports_export.rb
workarea-core-3.4.16 app/workers/workarea/process_reports_export.rb
workarea-core-3.4.15 app/workers/workarea/process_reports_export.rb
workarea-core-3.4.14 app/workers/workarea/process_reports_export.rb