summaryrefslogtreecommitdiff
path: root/bin/sql_db.py
diff options
context:
space:
mode:
authorChristophe Simonis <chs@openerp.com>2011-01-18 20:26:37 +0100
committerChristophe Simonis <chs@openerp.com>2011-01-18 20:26:37 +0100
commit6d97e2c0ab6f838243c1e8bfb5bba4d029bf5e9f (patch)
tree804d79894d642f3ee02820215e9e3d0fadf4f84b /bin/sql_db.py
parent0d691b22305438ffc5b4e4525ecce96ef235f65f (diff)
[FIX] stop related crons when closing a database
bzr revid: chs@openerp.com-20110118192637-i0yyyo86pa2hzq1d
Diffstat (limited to 'bin/sql_db.py')
-rw-r--r--bin/sql_db.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/bin/sql_db.py b/bin/sql_db.py
index a7d46d78e00..b1822f6bb84 100644
--- a/bin/sql_db.py
+++ b/bin/sql_db.py
@@ -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'):