summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-11-26 23:05:29 +0000
committerGerrit Code Review <review@openstack.org>2018-11-26 23:05:29 +0000
commit3476bb87882702b9a1ab854cc76e5cd44928301c (patch)
treee3a3e3e159ca4fcb4b6506b06c67b66a50e1a03d
parent073dadfea590c74d8909236031898d72bb3841a6 (diff)
parent0482e1e6b22d879b56d77f204e5acc9e43f9f5c9 (diff)
Merge "Setup model before connection"
-rw-r--r--zuul/driver/sql/sqlconnection.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/zuul/driver/sql/sqlconnection.py b/zuul/driver/sql/sqlconnection.py
index f19eb56..d7f70d1 100644
--- a/zuul/driver/sql/sqlconnection.py
+++ b/zuul/driver/sql/sqlconnection.py
@@ -47,6 +47,9 @@ class SQLConnection(BaseConnection):
47 47
48 try: 48 try:
49 self.dburi = self.connection_config.get('dburi') 49 self.dburi = self.connection_config.get('dburi')
50 self.zuul_buildset_table, self.zuul_build_table \
51 = self._setup_models()
52
50 # Recycle connections if they've been idle for more than 1 second. 53 # Recycle connections if they've been idle for more than 1 second.
51 # MySQL connections are lightweight and thus keeping long-lived 54 # MySQL connections are lightweight and thus keeping long-lived
52 # connections around is not valuable. 55 # connections around is not valuable.
@@ -55,8 +58,6 @@ class SQLConnection(BaseConnection):
55 poolclass=sqlalchemy.pool.QueuePool, 58 poolclass=sqlalchemy.pool.QueuePool,
56 pool_recycle=self.connection_config.get('pool_recycle', 1)) 59 pool_recycle=self.connection_config.get('pool_recycle', 1))
57 self._migrate() 60 self._migrate()
58 self.zuul_buildset_table, self.zuul_build_table \
59 = self._setup_models()
60 self.tables_established = True 61 self.tables_established = True
61 except sa.exc.NoSuchModuleError: 62 except sa.exc.NoSuchModuleError:
62 self.log.exception( 63 self.log.exception(