Skip to content

Commit

Permalink
Add better logging (#1330)
Browse files Browse the repository at this point in the history
  • Loading branch information
hectorcorrea authored Feb 28, 2025
1 parent 7b40e79 commit 61fa34d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/jobs/file_inventory_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,15 @@ def filename_for_export
end

def update_inventory_request(user_id:, project:, job_id:, filename: )
Rails.logger.info "Export - updating inventory request details for project #{project.id}"
inventory_request = FileInventoryRequest.find_by(user_id: user_id, project_id: project.id, job_id: job_id)
request_details = { output_file: filename, project_title: project.title, file_size: File.size(filename) }
inventory_request.update(state: UserRequest::COMPLETED, request_details: request_details,
completion_time: Time.current.in_time_zone("America/New_York"))
Rails.logger.info "Export - updated inventory request details for project #{project.id}"
inventory_request
rescue ActiveRecord::StatementInvalid
Rails.logger.info "Export - updating inventory request details for project #{project.id} failed, about to retry"
ActiveRecord::Base.connection_pool.release_connection
retry
end
Expand Down

0 comments on commit 61fa34d

Please sign in to comment.