Don't touch Issue/Merge Request when importing GitHub comments

parent 52daddc0
...@@ -152,12 +152,14 @@ module Gitlab ...@@ -152,12 +152,14 @@ module Gitlab
end end
def create_comments(issuable, comments) def create_comments(issuable, comments)
comments.each do |raw| ActiveRecord::Base.no_touching do
begin comments.each do |raw|
comment = CommentFormatter.new(project, raw) begin
issuable.notes.create!(comment.attributes) comment = CommentFormatter.new(project, raw)
rescue => e issuable.notes.create!(comment.attributes)
errors << { type: :comment, url: Gitlab::UrlSanitizer.sanitize(raw.url), errors: e.message } rescue => e
errors << { type: :comment, url: Gitlab::UrlSanitizer.sanitize(raw.url), errors: e.message }
end
end end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment