Memoize Akismet client initialization on AkismetHelper

parent eefc46e0
...@@ -5,8 +5,8 @@ module Gitlab ...@@ -5,8 +5,8 @@ module Gitlab
end end
def akismet_client def akismet_client
::Akismet::Client.new(current_application_settings.akismet_api_key, @akismet_client ||= ::Akismet::Client.new(current_application_settings.akismet_api_key,
Gitlab.config.gitlab.url) Gitlab.config.gitlab.url)
end end
def check_for_spam?(project, user) def check_for_spam?(project, user)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment