[REF] netsvc+ir_cron: removed unnecessary getLogger, removed double call to f/dispatch.

bzr revid: vmt@openerp.com-20110621083011-53toyp3lsa4rxs39
This commit is contained in:
Vo Minh Thu 2011-06-21 10:30:11 +02:00
parent 73a97f3c3b
commit 78986ba9d2
2 changed files with 4 additions and 7 deletions

View File

@ -102,11 +102,10 @@ class ir_cron(osv.osv, netsvc.Agent):
logger = logging.getLogger('execution time')
if logger.isEnabledFor(logging.DEBUG_RPC):
start_time = time.time()
f(cr, uid, *args)
f(cr, uid, *args)
if logger.isEnabledFor(logging.DEBUG_RPC):
end_time = time.time()
logger.log(logging.DEBUG_RPC, '%.3fs (%s, %s)' % (end_time - start_time, model, func))
else:
f(cr, uid, *args)
except Exception, e:
self._handle_callback_exception(cr, uid, model, func, args, job_id, e)

View File

@ -436,12 +436,10 @@ class OpenERPDispatcher:
auth = getattr(self, 'auth_provider', None)
if logger.isEnabledFor(logging.DEBUG_RPC):
start_time = time.time()
result = ExportService.getService(service_name).dispatch(method, auth, params)
result = ExportService.getService(service_name).dispatch(method, auth, params)
if logger.isEnabledFor(logging.DEBUG_RPC):
end_time = time.time()
logger = logging.getLogger('execution time')
self.log('execution time', tuple(replace_request_password(params)), depth=1, fn='%.3fs '%(end_time - start_time))
else:
result = ExportService.getService(service_name).dispatch(method, auth, params)
self.log('result', result, channel=logging.DEBUG_RPC_ANSWER)
return result
except Exception, e: