Skip to content
Snippets Groups Projects
Commit 29bc0d81 authored by Wolfgang Taferner's avatar Wolfgang Taferner Committed by Christophe Simonis
Browse files

[FIX] base: Make sure start time is not undefined

As debugging might be enabled during runtime we need to make sure that
the condition does only pass in case start time is defined
parent 42bb9aab
No related branches found
No related tags found
No related merge requests found
......@@ -114,10 +114,11 @@ class ir_cron(models.Model):
if hasattr(model, method_name):
log_depth = (None if _logger.isEnabledFor(logging.DEBUG) else 1)
odoo.netsvc.log(_logger, logging.DEBUG, 'cron.object.execute', (self._cr.dbname, self._uid, '*', model_name, method_name)+tuple(args), depth=log_depth)
start_time = False
if _logger.isEnabledFor(logging.DEBUG):
start_time = time.time()
getattr(model, method_name)(*args)
if _logger.isEnabledFor(logging.DEBUG):
if start_time and _logger.isEnabledFor(logging.DEBUG):
end_time = time.time()
_logger.debug('%.3fs (%s, %s)', end_time - start_time, model_name, method_name)
self.pool.signal_caches_change()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment