From f434e3c4d32b76c1b33b186cb8cb0f05b0e8a5ce Mon Sep 17 00:00:00 2001 From: nvi-openerp Date: Fri, 19 Nov 2010 10:38:12 +0100 Subject: [PATCH] [FIX] Fixed bug in crons that made the crons to launch in the current thread each time the ir.cron table was modified. bzr revid: nicolas.vanhoren@openerp.com-20101119093812-dq14n1qaxd0kz750 --- bin/addons/base/ir/ir_cron.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/addons/base/ir/ir_cron.py b/bin/addons/base/ir/ir_cron.py index 06121533922..334b131c20c 100644 --- a/bin/addons/base/ir/ir_cron.py +++ b/bin/addons/base/ir/ir_cron.py @@ -145,7 +145,8 @@ class ir_cron(osv.osv, netsvc.Agent): def restart(self, dbname): self.cancel(dbname) - self._poolJobs(dbname) + # Reschedule cron processing job asap, but not in the current thread + self.setAlarm(self._poolJobs, time.time(), dbname, dbname) def create(self, cr, uid, vals, context=None): res = super(ir_cron, self).create(cr, uid, vals, context=context)