mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-11-03 12:53:35 +08:00
Remove commented out block, edit comment
This commit is contained in:
@@ -44,6 +44,7 @@ REQUEST_ID: ContextVar[Union[Dict[str, str], None]] = ContextVar("request_id", d
|
||||
@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()
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user