diff options
| author | Christophe Simonis <chs@openerp.com> | 2010-09-06 17:29:27 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@openerp.com> | 2010-09-06 17:29:27 +0200 |
| commit | 0f8e08d61718742e5be73e9b14e88b3bee208b05 (patch) | |
| tree | a92c332f192e0b0770588e7b24bdc687d5508d44 /bin/pooler.py | |
| parent | d429b331e067d9e8f81a8499812ca60052ec75d5 (diff) | |
[FIX] cron: avoid multiple cron
bzr revid: chs@openerp.com-20100906152927-7xhtr8q4vqjqc26h
Diffstat (limited to 'bin/pooler.py')
| -rw-r--r-- | bin/pooler.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/bin/pooler.py b/bin/pooler.py index d0f38836504..7a572e71e0d 100644 --- a/bin/pooler.py +++ b/bin/pooler.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # @@ -15,7 +15,7 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# along with this program. If not, see <http://www.gnu.org/licenses/>. # ############################################################################## @@ -34,10 +34,10 @@ def get_db_and_pool(db_name, force_demo=False, status=None, update_module=False, import osv.osv pool = osv.osv.osv_pool() pool_dic[db_name] = pool - + try: addons.load_modules(db, force_demo, status, update_module) - except Exception, e: + except Exception: del pool_dic[db_name] raise @@ -51,13 +51,12 @@ def get_db_and_pool(db_name, force_demo=False, status=None, update_module=False, import report report.interface.register_all(db) if pooljobs: - pool.get('ir.cron')._poolJobs(db.dbname) + pool.get('ir.cron').restart(db.dbname) return db, pool def restart_pool(db_name, force_demo=False, status=None, update_module=False): if db_name in pool_dic: - pool_dic[db_name].get('ir.cron').cancel(db_name) del pool_dic[db_name] return get_db_and_pool(db_name, force_demo, status, update_module=update_module) |
