MCPcopy Index your code
hub / github.com/pgadmin-org/pgadmin4 / close_debugger_session

Function close_debugger_session

web/pgadmin/tools/debugger/__init__.py:2280–2308  ·  view source on GitHub ↗

This function is used to cancel the debugger transaction. :param trans_id: Transaction id :return:

(_trans_id, close_all=False)

Source from the content-addressed store, hash-verified

2278
2279
2280def close_debugger_session(_trans_id, close_all=False):
2281 """
2282 This function is used to cancel the debugger transaction.
2283
2284 :param trans_id: Transaction id
2285 :return:
2286 """
2287
2288 if close_all:
2289 trans_ids = DebuggerInstance.get_trans_ids()
2290 else:
2291 trans_ids = [_trans_id]
2292
2293 for trans_id in trans_ids:
2294 de_inst = DebuggerInstance(trans_id)
2295 dbg_obj = de_inst.debugger_data
2296
2297 try:
2298 if dbg_obj is not None:
2299 manager = get_driver(PG_DEFAULT_DRIVER).\
2300 connection_manager(dbg_obj['server_id'])
2301
2302 if manager is not None:
2303 release_connection(manager, dbg_obj)
2304
2305 de_inst.clear()
2306 except Exception:
2307 de_inst.clear()
2308 raise

Callers 2

on_logoutMethod · 0.85
closeFunction · 0.85

Calls 6

clearMethod · 0.95
DebuggerInstanceClass · 0.90
get_driverFunction · 0.90
release_connectionFunction · 0.85
get_trans_idsMethod · 0.80
connection_managerMethod · 0.80

Tested by

no test coverage detected