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
|
|
|
|
Rails.logger.error("UploadChecksumWorker: couldn't find upload #{upload_id}, skipping")
|
|
|
|
end
|
|
|
|
end
|