Skip to content

Commit

Permalink
Call later to fix SQLAlchemy error
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Oct 3, 2023
1 parent 23f674e commit ae9e931
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion c2cwsgiutils/request_tracking/_sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ def _add_session_id(session: Session, _transaction: Any, _connection: Any) -> No

def init() -> None:
"""Initialize the SQL alchemy session selector."""
sqlalchemy.event.listen(Session, "after_begin", _add_session_id)

sqlalchemy.event.listen(Session, "after_transaction_create", _add_session_id)

0 comments on commit ae9e931

Please sign in to comment.