Added log output to cron job runner.
This commit is contained in:
parent
270910f6be
commit
b55ad25f58
1 changed files with 7 additions and 3 deletions
|
@ -321,9 +321,13 @@ class MatematWebserver(object):
|
|||
|
||||
def _cron_runner(self, fun: Callable[[Dict[str, str], jinja2.Environment, logging.Logger], None]):
|
||||
self._httpd.logger.info('Executing cron job "%s"', fun.__name__)
|
||||
fun(self._httpd.pagelet_variables,
|
||||
self._httpd.jinja_env,
|
||||
self._httpd.logger)
|
||||
try:
|
||||
fun(self._httpd.pagelet_variables,
|
||||
self._httpd.jinja_env,
|
||||
self._httpd.logger)
|
||||
self._httpd.logger.info('Completed cron job "%s"', fun.__name__)
|
||||
except BaseException as e:
|
||||
self._httpd.logger.exception('Cron job "%s" failed:', fun.__name__, exc_info=e)
|
||||
|
||||
|
||||
class HttpHandler(BaseHTTPRequestHandler):
|
||||
|
|
Loading…
Reference in a new issue