mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 09:36:19 -05:00
FIX: importer performance of update_tl0, and give feedback during vanilla_mysql's create_permalinks
This commit is contained in:
parent
2facb6190f
commit
3b119dac6d
2 changed files with 4 additions and 2 deletions
|
@ -705,9 +705,9 @@ class ImportScripts::Base
|
||||||
total_count = User.count
|
total_count = User.count
|
||||||
progress_count = 0
|
progress_count = 0
|
||||||
|
|
||||||
User.find_each do |user|
|
User.includes(:user_stat).find_each do |user|
|
||||||
begin
|
begin
|
||||||
user.change_trust_level!(0) if Post.where(user_id: user.id).count == 0
|
user.update_columns(trust_level: 0) if user.trust_level > 0 && user.post_count == 0
|
||||||
rescue Discourse::InvalidAccess
|
rescue Discourse::InvalidAccess
|
||||||
nil
|
nil
|
||||||
end
|
end
|
||||||
|
|
|
@ -364,6 +364,7 @@ class ImportScripts::VanillaSQL < ImportScripts::Base
|
||||||
ucf = u.custom_fields
|
ucf = u.custom_fields
|
||||||
if ucf && ucf["import_id"] && ucf["import_username"]
|
if ucf && ucf["import_id"] && ucf["import_username"]
|
||||||
Permalink.create( url: "profile/#{ucf['import_id']}/#{ucf['import_username']}", external_url: "/users/#{u.username}" ) rescue nil
|
Permalink.create( url: "profile/#{ucf['import_id']}/#{ucf['import_username']}", external_url: "/users/#{u.username}" ) rescue nil
|
||||||
|
print '.'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -378,6 +379,7 @@ class ImportScripts::VanillaSQL < ImportScripts::Base
|
||||||
else
|
else
|
||||||
Permalink.create( url: "discussion/comment/#{id}", post_id: post.id ) rescue nil
|
Permalink.create( url: "discussion/comment/#{id}", post_id: post.id ) rescue nil
|
||||||
end
|
end
|
||||||
|
print '.'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue