From e8c99eaa2aaaadb3abb9597b0edd0db5b58c555f Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 3 May 2012 12:37:38 +0530 Subject: [PATCH] fixes in scheduler logging --- py/webnotes/utils/scheduler.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/py/webnotes/utils/scheduler.py b/py/webnotes/utils/scheduler.py index a2122a3b99..1e3126cf85 100644 --- a/py/webnotes/utils/scheduler.py +++ b/py/webnotes/utils/scheduler.py @@ -49,7 +49,6 @@ def execute(): if not webnotes.conn: webnotes.connect() - webnotes.conn.begin() out = [] # if first task of the day execute daily tasks @@ -73,6 +72,7 @@ def execute(): out.append('all:' + trigger('execute_all')) + webnotes.conn.begin() webnotes.conn.set_global('scheduler_last_event', nowtime.strftime(format)) webnotes.conn.commit() @@ -97,10 +97,12 @@ def log(method): import webnotes webnotes.conn.rollback() traceback = webnotes.getTraceback() - + import webnotes.utils + webnotes.conn.begin() webnotes.conn.sql("""insert into __SchedulerLog (`timestamp`, method, error) values (%s, %s, %s)""", (webnotes.utils.now_datetime(), method, traceback)) + webnotes.conn.commit() return traceback