DEV: Do not clean up chat message uploads (#14267)
This commit is contained in:
parent
5c0ad215af
commit
f4cca4af75
|
@ -39,6 +39,10 @@ module Jobs
|
||||||
next if ReviewableQueuedPost.pending.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?
|
next if Draft.where("data LIKE '%#{upload.sha1}%' OR data LIKE '%#{encoded_sha}%'").exists?
|
||||||
next if ThemeSetting.where(data_type: ThemeSetting.types[:upload]).where("value LIKE ?", "%#{upload.sha1}%").exists?
|
next if ThemeSetting.where(data_type: ThemeSetting.types[:upload]).where("value LIKE ?", "%#{upload.sha1}%").exists?
|
||||||
|
if defined?(ChatMessage) &&
|
||||||
|
ChatMessage.where("message LIKE ? OR message LIKE ?", "%#{upload.sha1}%", "%#{encoded_sha}%").exists?
|
||||||
|
next
|
||||||
|
end
|
||||||
upload.destroy
|
upload.destroy
|
||||||
else
|
else
|
||||||
upload.delete
|
upload.delete
|
||||||
|
|
Loading…
Reference in New Issue