Commit 3718f4ec authored by Matthias Käppler's avatar Matthias Käppler

Merge branch '21067-reduce-SQL-calls-when-creating-SystemNotes' into 'master'

Reduce number of SQL queries on SystemNote create

See merge request gitlab-org/gitlab!59102
parents 82df6502 15235ecb
...@@ -13,10 +13,10 @@ module SystemNotes ...@@ -13,10 +13,10 @@ module SystemNotes
protected protected
def create_note(note_summary) def create_note(note_summary)
note = Note.create(note_summary.note.merge(system: true)) note_params = note_summary.note.merge(system: true)
note.system_note_metadata = SystemNoteMetadata.new(note_summary.metadata) if note_summary.metadata? note_params[:system_note_metadata] = SystemNoteMetadata.new(note_summary.metadata) if note_summary.metadata?
note Note.create(note_params)
end end
def content_tag(*args) def content_tag(*args)
......
---
title: Reduce number of SQL queries when creating SystemNotes
merge_request: 59102
author:
type: performance
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