accelerate speed about 70 times

This commit is contained in:
chiu 2020-05-26 20:41:54 +08:00
parent faf8d57a31
commit a6aff16099
1 changed files with 2 additions and 2 deletions

View File

@ -359,8 +359,8 @@ F cats = files_by_cateogry.keys.collect do |cat|
def check_cat_sort_data
categories_temp = ModuleApp.where(:key => "archive").first.categories
categories_temp.each do |category|
archive_cat = ArchiveCategory.all.select{ |value| value.category_id.to_s == category.id.to_s}
if archive_cat.length == 0
archive_cat = ArchiveCategory.where(:category_id => category.id)
if archive_cat.count == 0
ArchiveCategory.create(category_id: category.id.to_s)
end
end