summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrpereira2 <rpereira@gitlab.com>2019-08-07 19:38:03 +0530
committerrpereira2 <rpereira@gitlab.com>2019-08-07 19:38:03 +0530
commit2de8ca7224ccd1375dc582800c2c5337da86d9f4 (patch)
tree0db954a9725b3c9ce5c5cbdcf6583c7927750311
parenta863f0f1aea2393a5bd307bbe56e5f2f51a5d6b5 (diff)
downloadgitlab-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.rb10
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?