[IMP] gunicorn: installing modules with multiple processes works.
bzr revid: vmt@openerp.com-20120208170926-1ydiw27j560yv0vz
This commit is contained in:
+1
-1
@@ -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
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user