mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 07:53:49 +08:00
FIX: always show the progress bars when skipping posts/users in importers
This commit is contained in:
@ -228,11 +228,10 @@ class ImportScripts::Base
|
||||
results.each do |result|
|
||||
u = yield(result)
|
||||
|
||||
# block returns nil to skip a post
|
||||
if u.nil?
|
||||
users_skipped += 1
|
||||
next # block returns nil to skip a post
|
||||
end
|
||||
|
||||
else
|
||||
import_id = u[:id]
|
||||
|
||||
if user_id_from_imported_user_id(import_id)
|
||||
@ -251,6 +250,7 @@ class ImportScripts::Base
|
||||
@failed_users << u
|
||||
puts "Skipping user id #{import_id} because email is blank"
|
||||
end
|
||||
end
|
||||
|
||||
print_status users_created + users_skipped + @failed_users.length + (opts[:offset] || 0), total
|
||||
end
|
||||
@ -370,11 +370,10 @@ class ImportScripts::Base
|
||||
results.each do |r|
|
||||
params = yield(r)
|
||||
|
||||
# block returns nil to skip a post
|
||||
if params.nil?
|
||||
skipped += 1
|
||||
next # block returns nil to skip a post
|
||||
end
|
||||
|
||||
else
|
||||
import_id = params.delete(:id).to_s
|
||||
|
||||
if post_id_from_imported_post_id(import_id)
|
||||
@ -406,6 +405,7 @@ class ImportScripts::Base
|
||||
puts e.backtrace.join("\n")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
print_status skipped + created + (opts[:offset] || 0), total
|
||||
end
|
||||
|
Reference in New Issue
Block a user