mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
always try to close the connection before reconnecting.
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user