Ignore errors when remapping posts

This commit is contained in:
Gerhard Schlager 2017-12-28 15:13:01 +01:00
parent a93bf186c5
commit 81427e26ea
1 changed files with 7 additions and 3 deletions

View File

@ -138,9 +138,13 @@ def remap_posts(find, type, replace = "")
end
if new_raw != p.raw
p.revise(Discourse.system_user, { raw: new_raw }, bypass_bump: true, skip_revision: true)
putc "."
i += 1
begin
p.revise(Discourse.system_user, { raw: new_raw }, bypass_bump: true, skip_revision: true)
putc "."
i += 1
rescue
puts "\nFailed to remap post (topic_id: #{p.topic_id}, post_id: #{p.id})\n"
end
end
end