diff options
author | Robert Speicher <rspeicher@gmail.com> | 2017-02-22 14:25:06 -0500 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2017-03-06 14:41:09 -0500 |
commit | 4c622b71fd284058deee483bf0009f8179b792bc (patch) | |
tree | 306cc2ffb5eec2d4fc972b33d14be2baf3959718 /app/workers | |
parent | 2a2b24d5a7687abf7e7517eb011ba427852d6df0 (diff) | |
download | gitlab-ce-4c622b71fd284058deee483bf0009f8179b792bc.tar.gz |
Add Upload model and UploadChecksumWorker worker
Diffstat (limited to 'app/workers')
-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 |