Merge gevent branch

bzr revid: nicolas.vanhoren@openerp.com-20121115144620-osd8or906viqcodf
This commit is contained in:
niv-openerp 2012-11-15 15:46:20 +01:00
commit 0ce74b62ca
3 changed files with 13 additions and 3 deletions

View File

@ -224,6 +224,12 @@ def main():
check_root_user()
openerp.tools.config.parse_config(sys.argv[1:])
# TODO GEVENT if event
import gevent.monkey
gevent.monkey.patch_all()
import gevent_psycopg2
gevent_psycopg2.monkey_patch()
check_postgres_user()
openerp.netsvc.init_logger()
report_configuration()

View File

@ -83,8 +83,9 @@ def start_services():
netrpc_server.init_servers()
# Start the main cron thread.
if openerp.conf.max_cron_threads:
openerp.cron.start_master_thread()
# TODO GEVENT if event use greenlet in cron
#if openerp.conf.max_cron_threads:
# openerp.cron.start_master_thread()
# Start the top-level servers threads (normally HTTP, HTTPS, and NETRPC).
openerp.netsvc.Server.startAll()

View File

@ -424,7 +424,10 @@ def serve():
# TODO Change the xmlrpc_* options to http_*
interface = config['xmlrpc_interface'] or '0.0.0.0'
port = config['xmlrpc_port']
httpd = werkzeug.serving.make_server(interface, port, application, threaded=True)
#httpd = werkzeug.serving.make_server(interface, port, application, threaded=True)
# TODO GEVENT if event
from gevent.wsgi import WSGIServer
httpd = WSGIServer((interface, port), application)
_logger.info('HTTP service (werkzeug) running on %s:%s', interface, port)
httpd.serve_forever()