mirror of
https://github.com/discourse/discourse.git
synced 2025-09-05 08:59:27 +08:00
FIX: mbox importer and rake task were broken
This commit is contained in:
parent
f60b10d090
commit
ee18d9ace0
2 changed files with 14 additions and 10 deletions
|
@ -93,13 +93,17 @@ module ImportScripts::Mbox
|
|||
next if all_records_exist?(:posts, rows.map { |row| row['msg_id'] })
|
||||
|
||||
create_posts(rows, total: total_count, offset: offset) do |row|
|
||||
if row['email_date'].blank?
|
||||
puts "Date is missing. Skipping #{row['msg_id']}"
|
||||
nil
|
||||
elsif row['in_reply_to'].blank?
|
||||
map_first_post(row)
|
||||
else
|
||||
map_reply(row)
|
||||
begin
|
||||
if row['email_date'].blank?
|
||||
puts "Date is missing. Skipping #{row['msg_id']}"
|
||||
nil
|
||||
elsif row['in_reply_to'].blank?
|
||||
map_first_post(row)
|
||||
else
|
||||
map_reply(row)
|
||||
end
|
||||
rescue => e
|
||||
puts "Failed to map post for #{row['msg_id']}", e, e.backtrace.join("\n")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue