From 31340de4463b6968ebe61edfe23bf3cc2ede5655 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Mon, 26 Jan 2015 20:35:30 +0100 Subject: [PATCH] don't break the vBulletin importer when PrettyText times out --- script/import_scripts/vbulletin.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/script/import_scripts/vbulletin.rb b/script/import_scripts/vbulletin.rb index 5b755156d70..a3543c8b081 100644 --- a/script/import_scripts/vbulletin.rb +++ b/script/import_scripts/vbulletin.rb @@ -12,6 +12,8 @@ class ImportScripts::VBulletin < ImportScripts::Base def initialize super + @old_username_to_new_usernames = {} + @tz = TZInfo::Timezone.get(TIMEZONE) @htmlentities = HTMLEntities.new @@ -54,8 +56,6 @@ class ImportScripts::VBulletin < ImportScripts::Base def import_users puts "", "importing users" - @old_username_to_new_usernames = {} - user_count = mysql_query("SELECT COUNT(userid) count FROM user").first["count"] # TODO: add email back in when using real data @@ -303,6 +303,8 @@ class ImportScripts::VBulletin < ImportScripts::Base post.raw = new_raw post.save end + rescue PrettyText::JavaScriptError + nil ensure print_status(current += 1, max) end