diff options
author | Robert Speicher <rspeicher@gmail.com> | 2017-02-22 22:25:06 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2017-03-06 22:41:09 +0300 |
commit | 4c622b71fd284058deee483bf0009f8179b792bc (patch) | |
tree | 306cc2ffb5eec2d4fc972b33d14be2baf3959718 /app/workers/upload_checksum_worker.rb | |
parent | 2a2b24d5a7687abf7e7517eb011ba427852d6df0 (diff) |
Add Upload model and UploadChecksumWorker worker
Diffstat (limited to 'app/workers/upload_checksum_worker.rb')
-rw-r--r-- | app/workers/upload_checksum_worker.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/app/workers/upload_checksum_worker.rb b/app/workers/upload_checksum_worker.rb new file mode 100644 index 00000000000..78931f1258f --- /dev/null +++ b/app/workers/upload_checksum_worker.rb @@ -0,0 +1,12 @@ +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 |