[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:
parent
4f163f727a
commit
67aa6c461a
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue