debian-mirror-gitlab/app/workers/upload_checksum_worker.rb
2020-04-08 18:37:08 +05:30

15 lines
457 B
Ruby

# frozen_string_literal: true
class UploadChecksumWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker
feature_category :geo_replication
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