summaryrefslogtreecommitdiff
path: root/lib/tasks
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-10-07 10:35:03 +0000
committerRémy Coutable <remy@rymai.me>2016-10-07 10:35:03 +0000
commit0876b46024be019d9ef9846045d3941dcdf90981 (patch)
tree84ea7e0cd4a377963a4e4af28f683bb1fa323912 /lib/tasks
parent1be151621721d9e89c4c6514b8523e999e5e0fed (diff)
parent1c462cf7d6d61aebac9b909102f0e794cc9e409a (diff)
downloadgitlab-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 'lib/tasks')
-rw-r--r--lib/tasks/gitlab/shell.rake2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/tasks/gitlab/shell.rake b/lib/tasks/gitlab/shell.rake
index bb7eb852f1b..210899882b4 100644
--- a/lib/tasks/gitlab/shell.rake
+++ b/lib/tasks/gitlab/shell.rake
@@ -78,7 +78,7 @@ namespace :gitlab do
f.puts "PATH=#{ENV['PATH']}"
end
- Gitlab::Shell.new.generate_and_link_secret_token
+ Gitlab::Shell.ensure_secret_token!
end
desc "GitLab | Setup gitlab-shell"