Skip to content

Commit

Permalink
Remove commented out block, edit comment
Browse files Browse the repository at this point in the history
  • Loading branch information
jdavcs committed Jan 9, 2025
1 parent 2ba17ff commit 0acf625
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/galaxy/model/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
@contextlib.contextmanager
def transaction(session: Union[scoped_session, Session, "SessionlessContext"]):
"""Start a new transaction only if one is not present."""
# TODO The `session.begin` code has been removed. Once we can verify this does not break SQLAlchemy transactions, remove this helper + all references (561)
# temporary hack; need to fix access to scoped_session callable, not proxy
if isinstance(session, scoped_session):
session = session()
Expand All @@ -52,12 +53,7 @@ def transaction(session: Union[scoped_session, Session, "SessionlessContext"]):
yield
return # exit: can't use as a Session

yield # TODO once we can verify this does not break SQLAlchemy transactions, remove this helper completely (561 instances)
# if not session.in_transaction(): # type:ignore[union-attr]
# with session.begin(): # type:ignore[union-attr]
# yield
# else:
# yield
yield


def check_database_connection(session):
Expand Down

0 comments on commit 0acf625

Please sign in to comment.