Sha256: 72ff903f820dc49931bf27d09df4e4a17653636cb9b1f21131fbe845599df53f

Contents?: true

Size: 802 Bytes

Versions: 54

Compression:

Stored size: 802 Bytes

Contents

# frozen_string_literal: true

require_dependency "renalware/letters"

module Renalware
  module HD
    module SessionForms
      BatchPrintJob = Struct.new(:batch_id, :user_id) do
        include UsingTempFolder

        # Returns the name of a temp file containing the pdf data
        def perform
          in_a_temporary_folder do |dir|
            Dir.chdir(dir) do
              batch = Batch.find(batch_id)
              user = User.find(user_id)
              BatchCompilePdfs.call(batch, user)
            end
          end
        end

        def max_attempts
          1
        end

        def queue_name
          "hd_session_forms"
        end

        def priority
          0 # high
        end

        def destroy_failed_jobs?
          true
        end
      end
    end
  end
end

Version data entries

54 entries across 54 versions & 1 rubygems

Version Path
renalware-core-2.1.1 app/jobs/renalware/hd/session_forms/batch_print_job.rb
renalware-core-2.1.0 app/jobs/renalware/hd/session_forms/batch_print_job.rb
renalware-core-2.0.167 app/jobs/renalware/hd/session_forms/batch_print_job.rb
renalware-core-2.0.166 app/jobs/renalware/hd/session_forms/batch_print_job.rb
renalware-core-2.0.165 app/jobs/renalware/hd/session_forms/batch_print_job.rb
renalware-core-2.0.164 app/jobs/renalware/hd/session_forms/batch_print_job.rb
renalware-core-2.0.163 app/jobs/renalware/hd/session_forms/batch_print_job.rb
renalware-core-2.0.162 app/jobs/renalware/hd/session_forms/batch_print_job.rb
renalware-core-2.0.161 app/jobs/renalware/hd/session_forms/batch_print_job.rb
renalware-core-2.0.160 app/jobs/renalware/hd/session_forms/batch_print_job.rb
renalware-core-2.0.159 app/jobs/renalware/hd/session_forms/batch_print_job.rb
renalware-core-2.0.158 app/jobs/renalware/hd/session_forms/batch_print_job.rb
renalware-core-2.0.157 app/jobs/renalware/hd/session_forms/batch_print_job.rb
renalware-core-2.0.156 app/jobs/renalware/hd/session_forms/batch_print_job.rb
renalware-core-2.0.155 app/jobs/renalware/hd/session_forms/batch_print_job.rb
renalware-core-2.0.153 app/jobs/renalware/hd/session_forms/batch_print_job.rb
renalware-core-2.0.152 app/jobs/renalware/hd/session_forms/batch_print_job.rb
renalware-core-2.0.151 app/jobs/renalware/hd/session_forms/batch_print_job.rb
renalware-core-2.0.149 app/jobs/renalware/hd/session_forms/batch_print_job.rb
renalware-core-2.0.148 app/jobs/renalware/hd/session_forms/batch_print_job.rb