Skip to content

Commit

Permalink
fix: close session upon aborted transaction
Browse files Browse the repository at this point in the history
Signed-off-by: F.N. Claessen <felix@seita.nl>
  • Loading branch information
Flix6x committed Jan 12, 2024
1 parent 1ff7e99 commit 11b4d3e
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def upgrade():
except ProgrammingError as exception:
print(f"Table {table} not found, continuing...")
print(exception)
db.session.close() # current transaction is aborted, commands ignored until end of transaction block
db.session.close() # https://stackoverflow.com/a/26346280/13775459

if tables_with_data:
Expand Down

0 comments on commit 11b4d3e

Please sign in to comment.