Set pool_recycle for beaker sessions
Occasionally a beaker database connection will be disconnected due to a long period of database inactivity. This can cause users to be logged out before a session expires and can also cause internal server errors when users try to log in. This patch adds a sqlalchemy pool_recycle value of 10 minutes, so that beaker doesn't potentially try to use a connection that has been disconnected by the mysql server. Change-Id: Ida99efbba1e99e72c1610cd2335560706f1523d7 Closes-Bug: #1514290
This commit is contained in:
parent
2e5d56ad1f
commit
98dbf7e456
@ -217,6 +217,7 @@ def setup_app(config):
|
||||
'session.url': CONF.database.connection,
|
||||
'session.timeout': 604800,
|
||||
'session.validate_key': api_utils.get_token(),
|
||||
'session.sa.pool_recycle': 600
|
||||
}
|
||||
app = SessionMiddleware(app, beaker_conf)
|
||||
|
||||
|
@ -228,5 +228,6 @@ class SetupAppTestCase(base.BaseTestCase):
|
||||
'session.type': 'ext:database',
|
||||
'session.url': 'fake_connection',
|
||||
'session.timeout': 604800,
|
||||
'session.validate_key': get_token.return_value}
|
||||
'session.validate_key': get_token.return_value,
|
||||
'session.sa.pool_recycle': 600}
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user