mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 15:48:43 -05:00
FIX: use batches for speed, and show progress from importers' update_tl0
This commit is contained in:
parent
3c4cee5f62
commit
b1d78a4fd5
1 changed files with 8 additions and 1 deletions
|
@ -612,8 +612,15 @@ class ImportScripts::Base
|
|||
end
|
||||
|
||||
def update_tl0
|
||||
User.all.each do |user|
|
||||
puts "", "setting users with no posts to trust level 0"
|
||||
|
||||
total_count = User.count
|
||||
progress_count = 0
|
||||
|
||||
User.find_each do |user|
|
||||
user.change_trust_level!(0) if Post.where(user_id: user.id).count == 0
|
||||
progress_count += 1
|
||||
print_status(progress_count, total_count)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue