Some minor config tweaks to try and deal with some database timeout issues.

This commit is contained in:
Dan 2020-11-19 11:25:58 -05:00
parent b8a91a513b
commit 071c98d72e
2 changed files with 5 additions and 1 deletions

View File

@ -26,10 +26,14 @@ DB_PORT = environ.get('DB_PORT', default="5432")
DB_NAME = environ.get('DB_NAME', default="crc_dev")
DB_USER = environ.get('DB_USER', default="crc_user")
DB_PASSWORD = environ.get('DB_PASSWORD', default="crc_pass")
SQLALCHEMY_ENGINE_OPTIONS = {"pool_pre_ping": True} # May help with some disconnect issues.
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_DATABASE_URI = environ.get(
'SQLALCHEMY_DATABASE_URI',
default="postgresql://%s:%s@%s:%s/%s" % (DB_USER, DB_PASSWORD, DB_HOST, DB_PORT, DB_NAME)
)
TOKEN_AUTH_TTL_HOURS = float(environ.get('TOKEN_AUTH_TTL_HOURS', default=24))
SECRET_KEY = environ.get('SECRET_KEY', default="Shhhh!!! This is secret! And better darn well not show up in prod.")
FRONTEND_AUTH_CALLBACK = environ.get('FRONTEND_AUTH_CALLBACK', default="http://localhost:4200/session")

View File

@ -19,7 +19,6 @@ connexion_app = connexion.FlaskApp(__name__)
app = connexion_app.app
app.config.from_object('config.default')
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
if "TESTING" in os.environ and os.environ["TESTING"] == "true":
app.config.from_object('config.testing')
@ -28,6 +27,7 @@ else:
app.config.root_path = app.instance_path
app.config.from_pyfile('config.py', silent=True)
db = SQLAlchemy(app)
""":type: sqlalchemy.orm.SQLAlchemy"""