def _db_close(exc): if not db.is_closed(): db.close()
def process_response(self, req, res, resource): if not db.is_closed(): db.close()
def _db_connect(): if db.is_closed(): db.connect()
def before(): if db_proxy.is_closed(): db_proxy.connect()
def _db_close(exc): if not db_proxy.is_closed(): db_proxy.close()
def on_finish(self): if not db.is_closed(): db.close() return super(BaseHandler, self).on_finish()
def close_db(__): if not db.is_closed(): db.close()
def close_db(pad): if not db.is_closed(): db.close()
def connect_db(): if db.is_closed(): db.connect()
def _db_close(exc): if not database.is_closed(): database.close()
def disconnect_db(exc): from models import db if not db.is_closed(): db.close()