mysql ping with reconnect

This commit is contained in:
Clint Armstrong
2015-09-09 10:04:39 -04:00
parent b08300e425
commit 9610dac130
+1
View File
@@ -58,6 +58,7 @@ class DB:
else:
self.conn = MySQLdb.connect(host=db_server, port=db_port, user=db_username, passwd=db_password, db=db_dbname)
self.conn.autocommit(True)
self.conn.ping(True)
def query(self, sql):
try: