mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
better log messages
This commit is contained in:
@@ -61,7 +61,7 @@ class DB:
|
||||
self.conn = MySQLdb.connect(host=db_server, port=db_port, user=db_username, passwd=db_password, db=db_dbname)
|
||||
break
|
||||
except (AttributeError, MySQLdb.OperationalError):
|
||||
log.warning('WARNING: MySQL Error, reconnecting.')
|
||||
log.warning('WARNING: MySQL Error during connect, reconnecting.')
|
||||
time.sleep(.5)
|
||||
pass
|
||||
|
||||
@@ -73,6 +73,7 @@ class DB:
|
||||
cursor = self.conn.cursor()
|
||||
cursor.execute(sql)
|
||||
except (AttributeError, MySQLdb.OperationalError):
|
||||
log.warning('WARNING: MySQL Error during query, reconnecting.')
|
||||
self.connect()
|
||||
cursor = self.conn.cursor()
|
||||
cursor.execute(sql)
|
||||
|
Reference in New Issue
Block a user