diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-02-01 22:05:56 -0200 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-02-02 11:25:44 -0200 |
commit | 07384aa00d8a8759cdb29ba51ae32a6032ba2571 (patch) | |
tree | 0a422e926d6407cbee91247cfa6b70434639d6d3 | |
parent | eefc46e0d5310cce5b5a64c1b982d5348d465f83 (diff) | |
download | gitlab-ce-07384aa00d8a8759cdb29ba51ae32a6032ba2571.tar.gz |
Memoize Akismet client initialization on AkismetHelper
-rw-r--r-- | lib/gitlab/akismet_helper.rb | 4 |
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) |