Fix python monasca-api mysql server connection loss

This patch is a fix for MySQL connection timeouts that ocasionally
occurs on the python monasca-api after not being used for about 8
hours.

Reference for the change:
  http://docs.sqlalchemy.org/en/rel_0_9/core/pooling.html#pool-setting-recycle

Change-Id: I8186718aead27f7966e3c35dbd0f490884419955
This commit is contained in:
Flávio Ramalho 2016-12-19 14:51:11 -03:00
parent afeac3a3e8
commit 2f69bf0151
1 changed files with 1 additions and 1 deletions

View File

@ -50,7 +50,7 @@ class SQLRepository(object):
url = URL(**database_conf)
from sqlalchemy import create_engine
self._db_engine = create_engine(url)
self._db_engine = create_engine(url, pool_recycle=3600)
self.metadata = MetaData()