Skip to content

Commit

Permalink
fix: stop to active job
Browse files Browse the repository at this point in the history
  • Loading branch information
takaishi committed Nov 27, 2024
1 parent dc91ec5 commit acef2bf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/api/v1/check_in_conferences_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions app/jobs/generate_entrysheet_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit acef2bf

Please sign in to comment.