Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
3pia
VISPA
VISPA web
Commits
18d5118b
Commit
18d5118b
authored
Nov 12, 2015
by
Gero Müller
Browse files
add fix for mysql database gone aways
parent
102a72f9
Changes
2
Show whitespace changes
Inline
Side-by-side
conf/vispa.ini.sample
View file @
18d5118b
[database]
#sqlalchemy.url = sqlite:////var/db/vispa.db
#sqlalchemy.pool_size = 5
#sqlalchemy.pool_recycle = 3600
#sqlalchemy.max_overflow = 10
...
...
vispa/server.py
View file @
18d5118b
...
...
@@ -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
(
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment