gitlab-org--gitlab-foss/app/workers/upload_checksum_worker.rb

14 lines
373 B
Ruby
Raw Normal View History

# frozen_string_literal: true
class UploadChecksumWorker
include ApplicationWorker
def perform(upload_id)
upload = Upload.find(upload_id)
2018-01-29 12:57:34 -05:00
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