From b8b7786efc889007ee32598413fa64b596935dc8 Mon Sep 17 00:00:00 2001 From: Neil Williams Date: Mon, 12 Nov 2012 14:59:02 -0800 Subject: [PATCH] app_globals: Move queue declarations to setup() etc. It now relies on ini file configuration. --- r2/r2/config/environment.py | 2 +- r2/r2/lib/app_globals.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/r2/r2/config/environment.py b/r2/r2/config/environment.py index 07a5468a5..0aba87e5a 100644 --- a/r2/r2/config/environment.py +++ b/r2/r2/config/environment.py @@ -53,9 +53,9 @@ def load_environment(global_conf={}, app_conf={}, setup_globals=True): template_engine='mako', paths=paths) g = config['pylons.g'] = Globals(global_conf, app_conf, paths) - g.plugins.declare_queues(g.queues) if setup_globals: g.setup() + g.plugins.declare_queues(g.queues) r2.config.cache = g.cache g.plugins.load_plugins() config['r2.plugins'] = g.plugins diff --git a/r2/r2/lib/app_globals.py b/r2/r2/lib/app_globals.py index 47e68d7ba..9685c3910 100755 --- a/r2/r2/lib/app_globals.py +++ b/r2/r2/lib/app_globals.py @@ -234,7 +234,6 @@ class Globals(object): self.config = ConfigValueParser(global_conf) self.config.add_spec(self.spec) self.plugins = PluginLoader(self.config.get("plugins", [])) - self.queues = queues.declare_queues(self) self.paths = paths @@ -263,6 +262,8 @@ class Globals(object): raise AttributeError def setup(self): + self.queues = queues.declare_queues(self) + # heavy load mode is read only mode with a different infobar if self.heavy_load_mode: self.read_only_mode = True