-
- Downloads
Merge branch 'memoize_shell_secret_token' into 'master'
Memoize Github::Shell's secret token ## What does this MR do? `API::Helpers#secret_token` was reading the secret file on every invocation. This MR reads the file in the `gitlab_shell_secret_token.rb` initializer and saves it as a class variable at `Gitlab::Shell.secret_token` ## Are there points in the code the reviewer needs to double check? - I'm not sure if the use of `cattr_accessor` is the best approach, or if should be moved into the `class << self` block? - Should `API::Helpers#secret_token` be removed in favor of using `Gitlab::Shell.secret_token`? ## Why was this MR needed? Performance optimization. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/22510 See merge request !6599
No related branches found
No related tags found
Showing
- CHANGELOG 1 addition, 0 deletionsCHANGELOG
- config/initializers/gitlab_shell_secret_token.rb 1 addition, 1 deletionconfig/initializers/gitlab_shell_secret_token.rb
- lib/api/helpers.rb 1 addition, 1 deletionlib/api/helpers.rb
- lib/gitlab/backend/shell.rb 31 additions, 15 deletionslib/gitlab/backend/shell.rb
- lib/tasks/gitlab/shell.rake 1 addition, 1 deletionlib/tasks/gitlab/shell.rake
- spec/lib/gitlab/backend/shell_spec.rb 6 additions, 3 deletionsspec/lib/gitlab/backend/shell_spec.rb
Please register or sign in to comment