diff options
author | rpereira2 <rpereira@gitlab.com> | 2019-08-07 19:38:03 +0530 |
---|---|---|
committer | rpereira2 <rpereira@gitlab.com> | 2019-08-07 19:38:03 +0530 |
commit | 2de8ca7224ccd1375dc582800c2c5337da86d9f4 (patch) | |
tree | 0db954a9725b3c9ce5c5cbdcf6583c7927750311 | |
parent | a863f0f1aea2393a5bd307bbe56e5f2f51a5d6b5 (diff) | |
download | gitlab-ce-56883-expire-current-settings.tar.gz |
Use strong_memoize in application_settings method56883-expire-current-settings
-rw-r--r-- | app/services/self_monitoring/project/create_service.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/services/self_monitoring/project/create_service.rb b/app/services/self_monitoring/project/create_service.rb index 5c9ca34878c..c925c6a1610 100644 --- a/app/services/self_monitoring/project/create_service.rb +++ b/app/services/self_monitoring/project/create_service.rb @@ -4,6 +4,7 @@ module SelfMonitoring module Project class CreateService < ::BaseService include Stepable + include Gitlab::Utils::StrongMemoize VISIBILITY_LEVEL = Gitlab::VisibilityLevel::INTERNAL PROJECT_NAME = 'GitLab Instance Administration' @@ -141,11 +142,10 @@ module SelfMonitoring end def application_settings - return @application_settings if @application_settings - - Gitlab::CurrentSettings.expire_current_application_settings - - @application_settings = Gitlab::CurrentSettings.current_application_settings + strong_memoize(:application_settings) do + Gitlab::CurrentSettings.expire_current_application_settings + Gitlab::CurrentSettings.current_application_settings + end end def project_created? |