diff --git a/app/controllers/api/v1/check_in_conferences_controller.rb b/app/controllers/api/v1/check_in_conferences_controller.rb index 9613f302d..bc97bdc17 100644 --- a/app/controllers/api/v1/check_in_conferences_controller.rb +++ b/app/controllers/api/v1/check_in_conferences_controller.rb @@ -13,7 +13,7 @@ def create check_in_timestamp = Time.zone.at(@params[:checkInTimestamp]) @check_in = CheckInConference.new(profile: attendee, conference:, check_in_timestamp:, scanner_profile_id: @profile.id) conference = Conference.find_by(abbr: @params[:eventAbbr]) - GenerateEntrysheetJob.perform_later(conference.id, attendee.id, speaker&.id, @params[:printerId]) + GenerateEntrysheetJob.perform_now(conference.id, attendee.id, speaker&.id, @params[:printerId]) if @check_in.save render(json: @check_in, status: :created) diff --git a/app/jobs/generate_entrysheet_job.rb b/app/jobs/generate_entrysheet_job.rb index 9f70da5bf..1672e9ca3 100644 --- a/app/jobs/generate_entrysheet_job.rb +++ b/app/jobs/generate_entrysheet_job.rb @@ -44,5 +44,7 @@ def perform(conference_id, profile_id, speaker_id = nil, printer_id = nil) response = client.create_printjob(job) puts("印刷ジョブID: #{response}") + ensure + File.exists?(pdf_file) && File.delete(pdf_file) end end