Memoize Akismet client initialization on AkismetHelper

parent eefc46e0
......@@ -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)
......
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