From 6d97e2c0ab6f838243c1e8bfb5bba4d029bf5e9f Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Tue, 18 Jan 2011 20:26:37 +0100 Subject: [PATCH] [FIX] stop related crons when closing a database bzr revid: chs@openerp.com-20110118192637-i0yyyo86pa2hzq1d --- bin/sql_db.py | 3 +++ 1 file changed, 3 insertions(+) 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 (). +# Copyright (C) 2010-2011 OpenERP s.a. (). # # 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'):