Better SQL connection settings

This commit is contained in:
Scott Idem
2023-07-12 13:46:27 -04:00
parent 236ef204eb
commit 9f99ca23ba
2 changed files with 10 additions and 2 deletions

View File

@@ -26,6 +26,10 @@ class Settings(BaseSettings):
DB['username'] = ''
DB['password'] = ''
SQLALCHEMY_DB_URI = 'mysql://'+DB['username']+':'+DB['password']+'@'+DB['server']+'/'+DB['name']
DB['wait_timeout'] = int(os.getenv('AE_DB_WAIT_TIMEOUT', 1800)) # default = 28800; Time (seconds) that the server waits for a connection to become active before closing it.
DB['connect_timeout'] = int(os.getenv('AE_DB_CONNECTION_TIMEOUT', 20)) # default = 10; Time (seconds) that the server waits for a connection to become active before closing it.
DB['pool_recycle'] = int(os.getenv('AE_DB_POOL_RECYCLE', 1800)) # default = ?; Related to SQLAlchemy
# Aether API log files paths