fixed gevent monkey patching problem, thank you JimK

This commit is contained in:
mdipierro
2013-01-23 08:49:00 -06:00
parent b1f77b9c4a
commit 4c50c69fbb
2 changed files with 8 additions and 6 deletions

View File

@@ -1 +1 @@
Version 2.4.1-alpha.2+timestamp.2013.01.23.08.17.15
Version 2.4.1-alpha.2+timestamp.2013.01.23.08.48.16

View File

@@ -17,8 +17,6 @@ import urllib
path = os.path.dirname(os.path.abspath(__file__))
os.chdir(path)
sys.path = [path] + [p for p in sys.path if not p == path]
import gluon.main
from gluon.fileutils import read_file, write_file
class Servers:
@@ -92,8 +90,6 @@ class Servers:
@staticmethod
def gevent(app, address, **options):
from gevent import monkey
monkey.patch_all()
from gevent import pywsgi
from gevent.pool import Pool
pywsgi.WSGIServer(address, app, spawn='workers' in options and Pool(
@@ -181,6 +177,12 @@ class Servers:
s.start()
def run(servername, ip, port, softcron=True, logging=False, profiler=None):
if servername == 'gevent':
from gevent import monkey
monkey.patch_all()
import gluon.main
if logging:
application = gluon.main.appfactory(wsgiapp=gluon.main.wsgibase,
logfilename='httpserver.log',
@@ -301,7 +303,7 @@ def mongrel2_handler(application, conn, debug=False):
def main():
usage = "python anyserver.py -s tornado -i 127.0.0.1 -p 8000 -l -P"
try:
version = read_file('VERSION')
version = open('VERSION','r')
except IOError:
version = ''
parser = optparse.OptionParser(usage, None, optparse.Option, version)