def on_finish(self): # save to database... browser_log = log( logLevel='INFO', logType='access', requestStatus=self.get_status(), requestType=self.request.method, requestURL=self.request.uri, requestIP=self.request.remote_ip, requestDuration=1000.0 * self.request.request_time() ) browser_log.save() if not database.is_closed(): database.close() return super(BaseHandler, self).on_finish()
def teardown(exception): if not database.is_closed(): database.close()
def _db_close(e): if not database.is_closed(): database.close()
def on_finish(self): if not database.is_closed(): database.close() return super(BaseHandler, self).on_finish()