Do not load settings which are not active (module not loaded)
Restart the bot, on heavy DB errors, with an 30 seconds delay (like: all connections terminated by DB, table_definition_cache exhausted) Fix for channel prefixing (org <-> priv)
This commit is contained in:
@@ -76,6 +76,14 @@ class DB:
|
||||
except Exception as e:
|
||||
raise SqlException(f"SQL Error: '{str(e)}' for '{sql}' "
|
||||
f"[{', '.join(map(lambda x: str(x), params))}]") from e
|
||||
except mariadb.OperationalError as e:
|
||||
self.logger.error("Please use 'FLUSH TABLES;' inside of the DB, and consider upping the 'table_definition_cache' value of the Database Server.", e)
|
||||
time.sleep(30)
|
||||
exit(-3)
|
||||
except mariadb.PoolError as e:
|
||||
self.logger.error("No Connections available for the Connection Pool. Restarting in 30 seconds...", e)
|
||||
time.sleep(30)
|
||||
exit(-2)
|
||||
elapsed = time.time() - start_time
|
||||
result = callback(cur)
|
||||
if elapsed > 5:
|
||||
|
||||
Reference in New Issue
Block a user