mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 03:16:41 +08:00
PERF: Speed up migrate_to_s3 rake task by deleting optimized image record.
No point moving all optimized image files to tombstone when the store is changing. Also, `destroy_all` can easily blow memory since we are no loading in batches.
This commit is contained in:
parent
e4abc51866
commit
2adbec1b3c
|
@ -421,7 +421,7 @@ def migrate_to_s3
|
||||||
OptimizedImage
|
OptimizedImage
|
||||||
.joins("LEFT JOIN uploads u ON optimized_images.upload_id = u.id")
|
.joins("LEFT JOIN uploads u ON optimized_images.upload_id = u.id")
|
||||||
.where("u.id IS NOT NULL AND u.url LIKE '//%' AND optimized_images.url NOT LIKE '//%'")
|
.where("u.id IS NOT NULL AND u.url LIKE '//%' AND optimized_images.url NOT LIKE '//%'")
|
||||||
.destroy_all
|
.delete_all
|
||||||
|
|
||||||
puts "Rebaking posts with lightboxes..."
|
puts "Rebaking posts with lightboxes..."
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user