Memoize Akismet client initialization on AkismetHelper
This commit is contained in:
parent
eefc46e0d5
commit
07384aa00d
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue