Example #1
0
 def prepare(self):
     """
     peewee的连接池, request-hook(请求前连接)
     :return:
     """
     db_mysql.connect()
     return super(BaseRequestHandler, self).prepare()
Example #2
0
 def prepare(self):
     """
     peewee的连接池, request-hook(请求前连接)
     :return:
     """
     db_mysql.connect()
     return super(BaseRequestHandler, self).prepare()
Example #3
0
 def wrapper(*args, **kwargs):
     db_mysql.connect()
     method(*args, **kwargs)
     if not db_mysql.is_closed():
         db_mysql.close()