From 820068ddaf23373d172dbae5169c4b21538fe1d5 Mon Sep 17 00:00:00 2001 From: Gerhard Schlager Date: Tue, 22 Jun 2021 17:00:55 +0200 Subject: [PATCH] FIX: `fix_missing_s3` rake task could fail due to missing upload (#13479) --- lib/tasks/uploads.rake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/tasks/uploads.rake b/lib/tasks/uploads.rake index 42d089fcef6..2915cd2fb10 100644 --- a/lib/tasks/uploads.rake +++ b/lib/tasks/uploads.rake @@ -1006,7 +1006,8 @@ def fix_missing_s3 verification_status: Upload.verification_statuses[:invalid_etag] ).pluck(:id) ids.each do |id| - upload = Upload.find(id) + upload = Upload.find_by(id: id) + next if !upload tempfile = nil