- batch.each do |s|
- if @file
- @file.close
- @file = nil
- end
- begin
- i+=1
- next if s.thumbnail.exists? || !s.feature_image.exists?
- @file = File.open(s.feature_image.path)
- s.thumbnail = @file
- s.save!
- if @file
- @file.close
- end
- rescue Exception => e
- log_error(err, s, e)
- end
- end
- end