Merge "Setup model before connection"
This commit is contained in:
commit
3476bb8788
|
@ -47,6 +47,9 @@ class SQLConnection(BaseConnection):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.dburi = self.connection_config.get('dburi')
|
self.dburi = self.connection_config.get('dburi')
|
||||||
|
self.zuul_buildset_table, self.zuul_build_table \
|
||||||
|
= self._setup_models()
|
||||||
|
|
||||||
# Recycle connections if they've been idle for more than 1 second.
|
# Recycle connections if they've been idle for more than 1 second.
|
||||||
# MySQL connections are lightweight and thus keeping long-lived
|
# MySQL connections are lightweight and thus keeping long-lived
|
||||||
# connections around is not valuable.
|
# connections around is not valuable.
|
||||||
|
@ -55,8 +58,6 @@ class SQLConnection(BaseConnection):
|
||||||
poolclass=sqlalchemy.pool.QueuePool,
|
poolclass=sqlalchemy.pool.QueuePool,
|
||||||
pool_recycle=self.connection_config.get('pool_recycle', 1))
|
pool_recycle=self.connection_config.get('pool_recycle', 1))
|
||||||
self._migrate()
|
self._migrate()
|
||||||
self.zuul_buildset_table, self.zuul_build_table \
|
|
||||||
= self._setup_models()
|
|
||||||
self.tables_established = True
|
self.tables_established = True
|
||||||
except sa.exc.NoSuchModuleError:
|
except sa.exc.NoSuchModuleError:
|
||||||
self.log.exception(
|
self.log.exception(
|
||||||
|
|
Loading…
Reference in New Issue