diff options
Diffstat (limited to 'lib/gitlab/ci/parsers/security/common.rb')
-rw-r--r-- | lib/gitlab/ci/parsers/security/common.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/gitlab/ci/parsers/security/common.rb b/lib/gitlab/ci/parsers/security/common.rb index 0ac012b9fd1..67817c9f832 100644 --- a/lib/gitlab/ci/parsers/security/common.rb +++ b/lib/gitlab/ci/parsers/security/common.rb @@ -65,8 +65,14 @@ module Gitlab ) end + # New Oj parsers are not thread safe, therefore, + # we need to initialize them for each thread. + def introspect_parser + Thread.current[:introspect_parser] ||= Oj::Introspect.new(filter: "remediations") + end + def report_data - @report_data ||= Gitlab::Json.parse!(json_data) + @report_data ||= introspect_parser.parse(json_data) end def report_version |