Commit 18d5118b authored by Gero Müller's avatar Gero Müller
Browse files

add fix for mysql database gone aways

parent 102a72f9
[database]
#sqlalchemy.url = sqlite:////var/db/vispa.db
#sqlalchemy.pool_size = 5
#sqlalchemy.pool_recycle = 3600
#sqlalchemy.max_overflow = 10
......
......@@ -208,12 +208,19 @@ class Server(object):
'database',
'sqlalchemy.max_overflow',
'10'))
# https://github.com/mitsuhiko/flask-sqlalchemy/issues/2
# http://docs.sqlalchemy.org/en/latest/core/pooling.html#dealing-with-disconnects
pool_recycle = int(vispa.config(
'database',
'sqlalchemy.pool_recycle',
'7200'))
logger.info('Use database %s.' % sa_identifier)
try:
self._engine = sqlalchemy.create_engine(
sa_identifier,
echo=False,
pool_size=pool_size,
pool_recycle=pool_recycle,
max_overflow=max_overflow)
except TypeError:
self._engine = sqlalchemy.create_engine(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment