Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add better logging #1330

Merged
merged 1 commit into from
Feb 28, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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