Add ability to set pool_recycle via config.

This commit is contained in:
Ryan Kelly 2017-04-10 11:39:57 +10:00
parent 146e6e6588
commit 8e693129e6

View File

@ -120,7 +120,7 @@ class StaticNodeAssignment(object):
sqlkw["max_overflow"] = 0 sqlkw["max_overflow"] = 0
if "mysql" in self.driver: if "mysql" in self.driver:
# Guard against the db closing idle conections. # Guard against the db closing idle conections.
sqlkw["pool_recycle"] = 3600 sqlkw["pool_recycle"] = kw.get("pool_recycle", 3600)
self._engine = create_engine(sqluri, **sqlkw) self._engine = create_engine(sqluri, **sqlkw)
users.create(self._engine, checkfirst=True) users.create(self._engine, checkfirst=True)