fix recreate image failed error when too many images

This commit is contained in:
chiu 2020-03-17 17:47:28 +08:00
parent f0f5419e07
commit f7ab0b4bfe
1 changed files with 127 additions and 125 deletions

View File

@ -216,7 +216,9 @@ class Admin::GalleriesController < OrbitAdminController
albums.each{|album| count+=album.album_images.count }
Thread.new do
i = 0
albums.each do |album|
album_ids = albums.map{|v| v.id}.clone
album_ids.each do |album_id|
album = Album.find(album_id) rescue Album.new()
album.album_images.each do |image|
error = nil
all_version = image.file.versions.map{|k,v| k}