debian-mirror-gitlab/app/workers/upload_checksum_worker.rb

13 lines
334 B
Ruby
Raw Normal View History

2017-08-17 22:00:37 +05:30
class UploadChecksumWorker
include Sidekiq::Worker
include DedicatedSidekiqQueue
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")
end
end