[FIX] stop related crons when closing a database
bzr revid: chs@openerp.com-20110118192637-i0yyyo86pa2hzq1d
This commit is contained in:
parent
0d691b2230
commit
6d97e2c0ab
|
@ -3,6 +3,7 @@
|
|||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
|
||||
# Copyright (C) 2010-2011 OpenERP s.a. (<http://openerp.com>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
|
@ -53,6 +54,7 @@ psycopg2.extensions.register_type(psycopg2.extensions.new_type((700, 701, 1700,)
|
|||
|
||||
import tools
|
||||
from tools.func import wraps, frame_codeinfo
|
||||
from netsvc import Agent
|
||||
from datetime import datetime as mdt
|
||||
from datetime import timedelta
|
||||
import threading
|
||||
|
@ -382,6 +384,7 @@ def db_connect(db_name):
|
|||
|
||||
def close_db(db_name):
|
||||
_Pool.close_all(dsn(db_name))
|
||||
Agent.cancel(db_name)
|
||||
tools.cache.clean_caches_for_db(db_name)
|
||||
ct = currentThread()
|
||||
if hasattr(ct, 'dbname'):
|
||||
|
|
Loading…
Reference in New Issue