FIX: Only consider pending queued posts for cleaning up uploads
This commit is contained in:
parent
534d75310f
commit
f7ebfb1acc
|
@ -76,7 +76,7 @@ module Jobs
|
|||
result.find_each do |upload|
|
||||
if upload.sha1.present?
|
||||
encoded_sha = Base62.encode(upload.sha1.hex)
|
||||
next if ReviewableQueuedPost.where("payload->>'raw' LIKE '%#{upload.sha1}%' OR payload->>'raw' LIKE '%#{encoded_sha}%'").exists?
|
||||
next if ReviewableQueuedPost.pending.where("payload->>'raw' LIKE '%#{upload.sha1}%' OR payload->>'raw' LIKE '%#{encoded_sha}%'").exists?
|
||||
next if Draft.where("data LIKE '%#{upload.sha1}%' OR data LIKE '%#{encoded_sha}%'").exists?
|
||||
upload.destroy
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue