Mysql has gone way (Django 下的解决方法)
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