Merge pull request #4449 from pfaffman/importer-base-progress
importer/base.rb: improve progress reporting
This commit is contained in:
commit
30fbb91294
|
@ -583,15 +583,21 @@ class ImportScripts::Base
|
||||||
|
|
||||||
def update_user_stats
|
def update_user_stats
|
||||||
puts "", "Updating topic reply counts..."
|
puts "", "Updating topic reply counts..."
|
||||||
|
|
||||||
|
start_time = Time.now
|
||||||
|
progress_count = 0
|
||||||
|
total_count = User.real.count
|
||||||
|
|
||||||
User.find_each do |u|
|
User.find_each do |u|
|
||||||
u.create_user_stat if u.user_stat.nil?
|
u.create_user_stat if u.user_stat.nil?
|
||||||
us = u.user_stat
|
us = u.user_stat
|
||||||
us.update_topic_reply_count
|
us.update_topic_reply_count
|
||||||
us.save
|
us.save
|
||||||
print "."
|
progress_count += 1
|
||||||
|
print_status(progress_count, total_count, start_time)
|
||||||
end
|
end
|
||||||
|
|
||||||
puts "Updating first_post_created_at..."
|
puts "." "Updating first_post_created_at..."
|
||||||
|
|
||||||
sql = <<-SQL
|
sql = <<-SQL
|
||||||
WITH sub AS (
|
WITH sub AS (
|
||||||
|
|
Loading…
Reference in New Issue