gitlab-org--gitlab-foss/app/workers/upload_checksum_worker.rb
Mayra Cabrera 0ab89d8e36 Add a rubocop for Rails.logger
Suggests to use a JSON structured log instead

Related to https://gitlab.com/gitlab-org/gitlab-ce/issues/54102
2019-07-10 19:26:47 +00:00

13 lines
373 B
Ruby

# frozen_string_literal: true
class UploadChecksumWorker
include ApplicationWorker
def perform(upload_id)
upload = Upload.find(upload_id)
upload.calculate_checksum!
upload.save!
rescue ActiveRecord::RecordNotFound
Rails.logger.error("UploadChecksumWorker: couldn't find upload #{upload_id}, skipping") # rubocop:disable Gitlab/RailsLogger
end
end