diff options
author | Oswaldo Ferreira <oswaldo@gitlab.com> | 2018-08-10 17:45:27 -0300 |
---|---|---|
committer | Oswaldo Ferreira <oswaldo@gitlab.com> | 2018-08-10 17:45:27 -0300 |
commit | 91b0880b0fcbb63c9abd2ee64c47ecfdbcb139ae (patch) | |
tree | c079384fe3f2da1ad5b813f326a3be4a0317e66a | |
parent | d867a58c2b0202a4087b48b893c06906af584021 (diff) | |
download | gitlab-ce-osw-fix-gitaly-n-plus-one-on-note-creation.tar.gz |
Catch gitaly N+1 on noteosw-fix-gitaly-n-plus-one-on-note-creation
-rw-r--r-- | app/services/notes/create_service.rb | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/app/services/notes/create_service.rb b/app/services/notes/create_service.rb index 049e6c5a871..5963cde20bc 100644 --- a/app/services/notes/create_service.rb +++ b/app/services/notes/create_service.rb @@ -7,12 +7,7 @@ module Notes note = Notes::BuildService.new(project, current_user, params).execute - # n+1: https://gitlab.com/gitlab-org/gitlab-ce/issues/37440 - note_valid = Gitlab::GitalyClient.allow_n_plus_1_calls do - note.valid? - end - - return note unless note_valid + return note unless note.valid? # We execute commands (extracted from `params[:note]`) on the noteable # **before** we save the note because if the note consists of commands |