Example #1
0
    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()
Example #2
0
def teardown(exception):
    if not database.is_closed():
        database.close()
Example #3
0
def teardown(exception):
    if not database.is_closed():
        database.close()
Example #4
0
def _db_close(e):
    if not database.is_closed():
        database.close()
Example #5
0
 def on_finish(self):
     if not database.is_closed():
         database.close()
     return super(BaseHandler, self).on_finish()