2018-06-27 03:23:28 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-02-22 14:25:06 -05:00
|
|
|
class UploadChecksumWorker
|
2017-11-28 11:08:30 -05:00
|
|
|
include ApplicationWorker
|
2017-02-22 14:25:06 -05:00
|
|
|
|
|
|
|
def perform(upload_id)
|
|
|
|
upload = Upload.find(upload_id)
|
2018-01-29 12:57:34 -05:00
|
|
|
upload.calculate_checksum!
|
2017-02-22 14:25:06 -05:00
|
|
|
upload.save!
|
|
|
|
rescue ActiveRecord::RecordNotFound
|
2019-07-10 15:26:47 -04:00
|
|
|
Rails.logger.error("UploadChecksumWorker: couldn't find upload #{upload_id}, skipping") # rubocop:disable Gitlab/RailsLogger
|
2017-02-22 14:25:06 -05:00
|
|
|
end
|
|
|
|
end
|