##// 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 b' class SettingsModel(BaseModel):'
45 45 "get_setting_%s" % settings_key))
46 46 return r
47 47
48 def get_app_settings(self):
48 def get_app_settings(self, cache=False):
49 49 """Get's config from database, each config key is prefixed with
50 50 'rhodecode_' prefix, than global pylons config is updated with such
51 51 keys
52 52 """
53 53
54 ret = self.sa.query(RhodeCodeSettings)\
55 .options(FromCache("sql_cache_short",
56 "get_hg_settings")).all()
54 ret = self.sa.query(RhodeCodeSettings)
55
56 if cache:
57 ret = ret.options(FromCache("sql_cache_short", "get_hg_settings"))
57 58
58 59 if not ret:
59 60 raise Exception('Could not get application settings !')
General Comments 0
You need to be logged in to leave comments. Login now