[REF] pooler: expose a delete_pool method, can be useful to debug memory leaks.

bzr revid: vmt@openerp.com-20110427092836-284bci0an48nopwc
This commit is contained in:
Vo Minh Thu 2011-04-27 11:28:36 +02:00
parent 4f163f727a
commit 67aa6c461a
1 changed files with 7 additions and 4 deletions

View File

@ -61,10 +61,14 @@ def get_db_and_pool(db_name, force_demo=False, status=None, update_module=False,
return db, pool
def restart_pool(db_name, force_demo=False, status=None, update_module=False):
"""Delete an existing osv_pool and return a database connection and a newly initialized osv_pool."""
def delete_pool(db_name):
"""Delete an existing osv_pool."""
if db_name in pool_dic:
del pool_dic[db_name]
def restart_pool(db_name, force_demo=False, status=None, update_module=False):
"""Delete an existing osv_pool and return a database connection and a newly initialized osv_pool."""
delete_pool(db_name)
return get_db_and_pool(db_name, force_demo, status, update_module=update_module)
@ -75,7 +79,6 @@ def get_db(db_name):
def get_pool(db_name, force_demo=False, status=None, update_module=False):
"""Return an osv_pool."""
pool = get_db_and_pool(db_name, force_demo, status, update_module)[1]
return pool
return get_db_and_pool(db_name, force_demo, status, update_module)[1]
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: