Ir.cron: when an exception occurs, log it.

bzr revid: p_christ@hol.gr-20090613143734-crws6uecjnmxpjsy
This commit is contained in:
P. Christeas 2009-06-13 17:37:34 +03:00
parent 9c584b3f0f
commit fbd87ff960
1 changed files with 4 additions and 2 deletions

View File

@ -107,8 +107,10 @@ class ir_cron(osv.osv, netsvc.Agent):
addsql = ', active=False'
cr.execute("update ir_cron set nextcall=%s, numbercall=%s"+addsql+" where id=%s", (nextcall.strftime('%Y-%m-%d %H:%M:%S'), numbercall, job['id']))
cr.commit()
except:
print "Exception in cron!"
except Exception,ex:
logger=netsvc.Logger()
logger.notifyChannel('cron', netsvc.LOG_WARNING,
'Exception in cron:'+str(ex))
finally:
cr.commit()
cr.close()