mirror of
https://github.com/librenms/librenms.git
synced 2024-09-22 10:58:42 +00:00
always try to close the connection before reconnecting.
This commit is contained in:
parent
728b92f0ff
commit
cb3189e944
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user