def is_connection_usable(func):
def wrapper(*args, **kwargs):
result = None
try:
result = func(*args, **kwargs)
result[0]
except OperationalError:
connection.close()
result = func(*args, **kwargs)
return result
return wrapper
标签:方法 ror mysql cep err **kwargs connect gpo pos
def is_connection_usable(func):
def wrapper(*args, **kwargs):
result = None
try:
result = func(*args, **kwargs)
result[0]
except OperationalError:
connection.close()
result = func(*args, **kwargs)
return result
return wrapper
Mysql has gone way (Django 下的解决方法)
标签:方法 ror mysql cep err **kwargs connect gpo pos
原文地址:https://www.cnblogs.com/Rubick7/p/8421548.html