[IMP] gunicorn: installing modules with multiple processes works.

bzr revid: vmt@openerp.com-20120208170926-1ydiw27j560yv0vz
This commit is contained in:
Vo Minh Thu
2012-02-08 18:09:26 +01:00
parent b90736b3e7
commit 9d7f004c3b
3 changed files with 15 additions and 3 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ pidfile = '.gunicorn.pid'
# Gunicorn recommends 2-4 x number_of_cpu_cores, but
# you'll want to vary this a bit to find the best for your
# particular work load.
workers = 1
workers = 10
# Some application-wide initialization is needed.
on_starting = openerp.wsgi.on_starting
+2
View File
@@ -30,6 +30,7 @@ import urllib
import zipfile
import zipimport
import openerp
import openerp.modules as addons
import pooler
import release
@@ -344,6 +345,7 @@ class module(osv.osv):
if to_install_ids:
self.button_install(cr, uid, to_install_ids, context=context)
openerp.modules.registry.RegistryManager.signal_registry_change(cr.dbname)
return dict(ACTION_DICT, name=_('Install'))
def button_immediate_install(self, cr, uid, ids, context=None):
+12 -2
View File
@@ -143,6 +143,7 @@ class RegistryManager(object):
# must be reloaded.
# The `base_cache_signaling sequence` indicates all caches must be
# invalidated (i.e. cleared).
# TODO per registry
base_registry_signaling_sequence = 1
base_cache_signaling_sequence = 1
@@ -279,10 +280,19 @@ class RegistryManager(object):
cr = openerp.sql_db.db_connect(db_name).cursor()
try:
pass
# cr.execute("select nextval('base_registry_signaling')")
# cls.base_cache_signaling to = result
# cr.execute("select nextval('base_cache_signaling')")
# cls.base_cache_signaling_sequence to = result
finally:
cr.close()
registry.reset_any_cache_cleared()
@classmethod
def signal_registry_change(cls, db_name):
cr = openerp.sql_db.db_connect(db_name).cursor()
try:
cr.execute("select nextval('base_registry_signaling')")
finally:
cr.close()
#cls.base_registry_signaling_sequence to = result
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: