always try to close the connection before reconnecting.

This commit is contained in:
Clint Armstrong 2015-09-14 09:00:55 -04:00
parent 728b92f0ff
commit cb3189e944

View File

@ -54,6 +54,11 @@ class DB:
def connect(self):
while True:
try:
self.conn.close()
except:
pass
try:
if db_port == 0:
self.conn = MySQLdb.connect(host=db_server, user=db_username, passwd=db_password, db=db_dbname)