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:
2021-11-30 16:57:31 +01:00
parent c100b0ea76
commit bf6c1842d2
17 changed files with 57 additions and 29 deletions
+8
View File
@@ -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: