##// END OF EJS Templates
Added optional cache into get_application settings
marcink -
r892:9adc0c1d beta
parent child Browse files
Show More
@@ -45,15 +45,16 class SettingsModel(BaseModel):
45 "get_setting_%s" % settings_key))
45 "get_setting_%s" % settings_key))
46 return r
46 return r
47
47
48 def get_app_settings(self):
48 def get_app_settings(self, cache=False):
49 """Get's config from database, each config key is prefixed with
49 """Get's config from database, each config key is prefixed with
50 'rhodecode_' prefix, than global pylons config is updated with such
50 'rhodecode_' prefix, than global pylons config is updated with such
51 keys
51 keys
52 """
52 """
53
53
54 ret = self.sa.query(RhodeCodeSettings)\
54 ret = self.sa.query(RhodeCodeSettings)
55 .options(FromCache("sql_cache_short",
55
56 "get_hg_settings")).all()
56 if cache:
57 ret = ret.options(FromCache("sql_cache_short", "get_hg_settings"))
57
58
58 if not ret:
59 if not ret:
59 raise Exception('Could not get application settings !')
60 raise Exception('Could not get application settings !')
General Comments 0
You need to be logged in to leave comments. Login now