diff options
author | Rémy Coutable <remy@rymai.me> | 2016-10-07 10:35:03 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-10-07 10:35:03 +0000 |
commit | 0876b46024be019d9ef9846045d3941dcdf90981 (patch) | |
tree | 84ea7e0cd4a377963a4e4af28f683bb1fa323912 /config/initializers | |
parent | 1be151621721d9e89c4c6514b8523e999e5e0fed (diff) | |
parent | 1c462cf7d6d61aebac9b909102f0e794cc9e409a (diff) | |
download | gitlab-ce-0876b46024be019d9ef9846045d3941dcdf90981.tar.gz |
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
Diffstat (limited to 'config/initializers')
-rw-r--r-- | config/initializers/gitlab_shell_secret_token.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/config/initializers/gitlab_shell_secret_token.rb b/config/initializers/gitlab_shell_secret_token.rb index 7454c33c9dd..529dcdd4644 100644 --- a/config/initializers/gitlab_shell_secret_token.rb +++ b/config/initializers/gitlab_shell_secret_token.rb @@ -1 +1 @@ -Gitlab::Shell.new.generate_and_link_secret_token +Gitlab::Shell.ensure_secret_token! |