From 6c60619a2bfeec6f3241e47ff4dbe1dd4844132c Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Mon, 24 Sep 2012 12:36:48 +0200 Subject: [PATCH] [FIX] wsgi wrapper bzr revid: al@openerp.com-20120924103648-uhxteeu6nd8batvd --- openerp-wsgi.py | 7 ++++--- openerp/__init__.py | 2 +- openerp/service/__init__.py | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/openerp-wsgi.py b/openerp-wsgi.py index 5ab7afc406e..48ffeaf3373 100644 --- a/openerp-wsgi.py +++ b/openerp-wsgi.py @@ -7,7 +7,7 @@ # # For generic wsgi handlers a global application is defined. # For uwsgi this should work: -# $ uwsgi --http :9090 --pythonpath . --wsgi-file openerp-wsgi.py +# $ uwsgi_python --http :9090 --pythonpath . --wsgi-file openerp-wsgi.py # # For gunicorn additional globals need to be defined in the Gunicorn section. # Then the following command should run: @@ -18,15 +18,16 @@ import openerp #---------------------------------------------------------- # Common #---------------------------------------------------------- +openerp.multi_process = True # Nah! + # Equivalent of --load command-line option openerp.conf.server_wide_modules = ['web'] conf = openerp.tools.config # Path to the OpenERP Addons repository (comma-separated for # multiple locations) -conf['addons_path'] = '/home/openerp/addons/trunk,/home/openerp/web/trunk/addons' -conf['addons_path'] = '/home/wis/stuff/version/openerp/source/addons/6.1,/home/wis/stuff/version/openerp/source/web/6.1/addons' +conf['addons_path'] = '../../addons/trunk,../../web/trunk/addons' # Optional database config if not using local socket #conf['db_name'] = 'mycompany' diff --git a/openerp/__init__.py b/openerp/__init__.py index 2fd2a9812f9..3a8f5f86f26 100644 --- a/openerp/__init__.py +++ b/openerp/__init__.py @@ -50,7 +50,7 @@ wsgi.register_wsgi_handler = wsgi.wsgi_server.register_wsgi_handler # e.g. database update or cache invalidation. Each process has also # its own copy of the data structure and we don't need to care about # locks between threads. -multi_process = True +multi_process = False # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/openerp/service/__init__.py b/openerp/service/__init__.py index 30a765b1f60..ef0fd757ddd 100644 --- a/openerp/service/__init__.py +++ b/openerp/service/__init__.py @@ -78,8 +78,6 @@ def start_internal(): def start_services(): """ Start all services including http, netrpc and cron """ - openerp.multi_process = False # Nah! - start_internal() # Initialize the HTTP stack. @@ -120,6 +118,8 @@ def stop_services(): openerp.modules.registry.RegistryManager.delete_all() def start_services_workers(): + openerp.multi_process = True # Nah! + openerp.service.workers.Multicorn(openerp.service.wsgi_server.application).run()