MCPcopy Create free account
hub / github.com/diffgram/diffgram / session_scope_threaded

Function session_scope_threaded

shared/helpers/sessionMaker.py:134–148  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

132
133@contextmanager
134def session_scope_threaded():
135 import shared.database.input as input # TODO fix circular imports
136 """Provide a transactional scope around a series of operations.
137
138 """
139
140 session = scoped_session_registry()
141 try:
142 yield session
143 session.commit()
144 except Exception as e:
145 session.rollback()
146 raise
147 finally:
148 scoped_session_registry.remove()

Callers 3

process_new_eventMethod · 0.90
trigger_workflowFunction · 0.90
process_new_eventMethod · 0.90

Calls 2

commitMethod · 0.80
removeMethod · 0.45

Tested by

no test coverage detected