mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 15:25:35 +08:00
Rescue errors when running dry run for UploadRecovery
.
This commit is contained in:
parent
4dc25ad201
commit
a3b3b0810d
|
@ -5,6 +5,7 @@ class UploadRecovery
|
|||
|
||||
def recover
|
||||
Post.where("raw LIKE '%upload:\/\/%'").find_each do |post|
|
||||
begin
|
||||
analyzer = PostAnalyzer.new(post.raw, post.topic_id)
|
||||
cooked_stripped = analyzer.send(:cooked_stripped)
|
||||
|
||||
|
@ -23,6 +24,10 @@ class UploadRecovery
|
|||
end
|
||||
end
|
||||
end
|
||||
rescue => e
|
||||
raise e unless @dry_run
|
||||
puts "#{post.full_url} #{e.class}: #{e.message}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user