FIX: delete upload records when sha is null

This commit is contained in:
Régis Hanol 2017-11-21 10:20:42 +01:00
parent f7642e076d
commit c4d0eb802e
1 changed files with 3 additions and 1 deletions

View File

@ -55,8 +55,10 @@ module Jobs
encoded_sha = Base62.encode(upload.sha1.hex) encoded_sha = Base62.encode(upload.sha1.hex)
next if QueuedPost.where("raw LIKE '%#{upload.sha1}%' OR raw LIKE '%#{encoded_sha}%'").exists? next if QueuedPost.where("raw LIKE '%#{upload.sha1}%' OR raw LIKE '%#{encoded_sha}%'").exists?
next if Draft.where("data LIKE '%#{upload.sha1}%' OR data LIKE '%#{encoded_sha}%'").exists? next if Draft.where("data LIKE '%#{upload.sha1}%' OR data LIKE '%#{encoded_sha}%'").exists?
upload.destroy
else
upload.delete
end end
upload.destroy
end end
end end
end end