[llvm-commits] [zorg] r128447 - /zorg/trunk/llvmlab/llvmlab/ui/app.py
Daniel Dunbar
daniel at zuster.org
Mon Mar 28 19:59:26 PDT 2011
Author: ddunbar
Date: Mon Mar 28 21:59:25 2011
New Revision: 128447
URL: http://llvm.org/viewvc/llvm-project?rev=128447&view=rev
Log:
llvmlab: Work around an annoying property of the werkzeug reloader where the app instance is created twice. This means we end up with two monitor threads when running a debug server, which is not what we want.
Modified:
zorg/trunk/llvmlab/llvmlab/ui/app.py
Modified: zorg/trunk/llvmlab/llvmlab/ui/app.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/llvmlab/llvmlab/ui/app.py?rev=128447&r1=128446&r2=128447&view=diff
==============================================================================
--- zorg/trunk/llvmlab/llvmlab/ui/app.py (original)
+++ zorg/trunk/llvmlab/llvmlab/ui/app.py Mon Mar 28 21:59:25 2011
@@ -64,9 +64,6 @@
module = __import__(plugins_module, fromlist=['__name__'])
module.register(app)
- # Spawn the status monitor thread.
- app.monitor = app.config.status.start_monitor(app)
-
return app
@staticmethod
@@ -181,3 +178,14 @@
# Return the appropriate user object.
return self.config.data.users[id]
+
+ def __call__(self, environ, start_response):
+ # This works around an annoying property of the werkzeug reloader where
+ # we can't tell if we are in the actual web app instance.
+ #
+ # FIXME: Find a nicer solution.
+ if not self.monitor:
+ # Spawn the status monitor thread.
+ self.monitor = self.config.status.start_monitor(self)
+
+ return flask.Flask.__call__(self, environ, start_response)
More information about the llvm-commits
mailing list