# HG changeset patch # User Marcin Kuzminski # Date 1293621529 -3600 # Node ID 9adc0c1d9a87fa589a7a5a605c57f3a9f6d6b938 # Parent cca7286401b38b0a5d3e9b038941f7cbfdc078b7 Added optional cache into get_application settings diff -r cca7286401b3 -r 9adc0c1d9a87 rhodecode/model/settings.py --- a/rhodecode/model/settings.py Wed Dec 29 11:13:17 2010 +0100 +++ b/rhodecode/model/settings.py Wed Dec 29 12:18:49 2010 +0100 @@ -45,15 +45,16 @@ "get_setting_%s" % settings_key)) return r - def get_app_settings(self): + def get_app_settings(self, cache=False): """Get's config from database, each config key is prefixed with 'rhodecode_' prefix, than global pylons config is updated with such keys """ - ret = self.sa.query(RhodeCodeSettings)\ - .options(FromCache("sql_cache_short", - "get_hg_settings")).all() + ret = self.sa.query(RhodeCodeSettings) + + if cache: + ret = ret.options(FromCache("sql_cache_short", "get_hg_settings")) if not ret: raise Exception('Could not get application settings !')