Skip to content

Commit

Permalink
Disconnect Alembic connection to ensure it re-connects after backfill
Browse files Browse the repository at this point in the history
  • Loading branch information
Joseph Schorr committed Dec 13, 2019
1 parent bb47490 commit c6c6c2b
Showing 1 changed file with 6 additions and 0 deletions.
Expand Up @@ -130,6 +130,12 @@ class OAuthApplication(BaseModel):
def upgrade(tables, tester, progress_reporter):
op = ProgressWrapper(original_op, progress_reporter)

# NOTE: Disconnects the Alembic database connection. We do this because the Peewee calls below
# use a *different* connection, and if we leave the alembic connection open, it'll time out.
# See: https://github.com/sqlalchemy/alembic/issues/630
op.get_bind().execute("COMMIT")
op.get_bind().invalidate()

from app import app

if app.config.get("SETUP_COMPLETE", False) or tester.is_testing():
Expand Down

0 comments on commit c6c6c2b

Please sign in to comment.