Merge branch 'sh-use-nokogiri-xml-backend' into 'master'
Use Nokogiri as the ActiveSupport XML backend Closes #54068 See merge request gitlab-org/gitlab-ce!23136
This commit is contained in:
commit
348dd42d79
|
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
title: Use Nokogiri as the ActiveSupport XML backend
|
||||||
|
merge_request: 23136
|
||||||
|
author:
|
||||||
|
type: performance
|
||||||
|
|
@ -158,6 +158,9 @@ module Gitlab
|
||||||
|
|
||||||
config.action_view.sanitized_allowed_protocols = %w(smb)
|
config.action_view.sanitized_allowed_protocols = %w(smb)
|
||||||
|
|
||||||
|
# Nokogiri is significantly faster and uses less memory than REXML
|
||||||
|
ActiveSupport::XmlMini.backend = 'Nokogiri'
|
||||||
|
|
||||||
# This middleware needs to precede ActiveRecord::QueryCache and other middlewares that
|
# This middleware needs to precede ActiveRecord::QueryCache and other middlewares that
|
||||||
# connect to the database.
|
# connect to the database.
|
||||||
config.middleware.insert_after Rails::Rack::Logger, ::Gitlab::Middleware::BasicHealthCheck
|
config.middleware.insert_after Rails::Rack::Logger, ::Gitlab::Middleware::BasicHealthCheck
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ module Gitlab
|
||||||
test_case = create_test_case(test_case)
|
test_case = create_test_case(test_case)
|
||||||
test_suite.add_test_case(test_case)
|
test_suite.add_test_case(test_case)
|
||||||
end
|
end
|
||||||
rescue REXML::ParseException
|
rescue Nokogiri::XML::SyntaxError
|
||||||
raise JunitParserError, "XML parsing failed"
|
raise JunitParserError, "XML parsing failed"
|
||||||
rescue
|
rescue
|
||||||
raise JunitParserError, "JUnit parsing failed"
|
raise JunitParserError, "JUnit parsing failed"
|
||||||
|
|
|
||||||
|
|
@ -9,3 +9,4 @@ require 'active_support/all'
|
||||||
|
|
||||||
ActiveSupport::Dependencies.autoload_paths << 'lib'
|
ActiveSupport::Dependencies.autoload_paths << 'lib'
|
||||||
ActiveSupport::Dependencies.autoload_paths << 'ee/lib'
|
ActiveSupport::Dependencies.autoload_paths << 'ee/lib'
|
||||||
|
ActiveSupport::XmlMini.backend = 'Nokogiri'
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue