mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-30 10:58:31 -05:00
importer/base.rb: improve progress reporting
This commit is contained in:
parent
4f13422c47
commit
30f2081c1b
1 changed files with 8 additions and 2 deletions
|
@ -583,15 +583,21 @@ class ImportScripts::Base
|
|||
|
||||
def update_user_stats
|
||||
puts "", "Updating topic reply counts..."
|
||||
|
||||
start_time = Time.now
|
||||
progress_count = 0
|
||||
total_count = User.real.count
|
||||
|
||||
User.find_each do |u|
|
||||
u.create_user_stat if u.user_stat.nil?
|
||||
us = u.user_stat
|
||||
us.update_topic_reply_count
|
||||
us.save
|
||||
print "."
|
||||
progress_count += 1
|
||||
print_status(progress_count, total_count, start_time)
|
||||
end
|
||||
|
||||
puts "Updating first_post_created_at..."
|
||||
puts "." "Updating first_post_created_at..."
|
||||
|
||||
sql = <<-SQL
|
||||
WITH sub AS (
|
||||
|
|
Loading…
Reference in a new issue