Commit 07384aa0 authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre
Browse files

Memoize Akismet client initialization on AkismetHelper

parent eefc46e0
......@@ -5,8 +5,8 @@ def akismet_enabled?
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