summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-02-01 22:05:56 -0200
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-02-02 11:25:44 -0200
commit07384aa00d8a8759cdb29ba51ae32a6032ba2571 (patch)
tree0a422e926d6407cbee91247cfa6b70434639d6d3
parenteefc46e0d5310cce5b5a64c1b982d5348d465f83 (diff)
downloadgitlab-ce-07384aa00d8a8759cdb29ba51ae32a6032ba2571.tar.gz
Memoize Akismet client initialization on AkismetHelper
-rw-r--r--lib/gitlab/akismet_helper.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/gitlab/akismet_helper.rb b/lib/gitlab/akismet_helper.rb
index 71f525309fe..b366c89889e 100644
--- a/lib/gitlab/akismet_helper.rb
+++ b/lib/gitlab/akismet_helper.rb
@@ -5,8 +5,8 @@ module Gitlab
end
def akismet_client
- ::Akismet::Client.new(current_application_settings.akismet_api_key,
- Gitlab.config.gitlab.url)
+ @akismet_client ||= ::Akismet::Client.new(current_application_settings.akismet_api_key,
+ Gitlab.config.gitlab.url)
end
def check_for_spam?(project, user)