示例#1
0
 def on_finish(self):
     """
     peewee的request-hook(请求完成后关闭)
     :return:
     """
     if not db_mysql.is_closed():
         db_mysql.close()
     return super(BaseRequestHandler, self).on_finish()
示例#2
0
 def on_finish(self):
     """
     peewee的request-hook(请求完成后关闭)
     :return:
     """
     if not db_mysql.is_closed():
         db_mysql.close()
     return super(BaseRequestHandler, self).on_finish()
示例#3
0
 def wrapper(*args, **kwargs):
     db_mysql.connect()
     method(*args, **kwargs)
     if not db_mysql.is_closed():
         db_mysql.close()