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

Function restart_debugging

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

restart_debugging(trans_id) This method is responsible to restart the same function for the debugging. Parameters: trans_id - Transaction ID

(trans_id)

Source from the content-addressed store, hash-verified

965)
966@pga_login_required
967def restart_debugging(trans_id):
968 """
969 restart_debugging(trans_id)
970
971 This method is responsible to restart the same function for the debugging.
972
973 Parameters:
974 trans_id
975 - Transaction ID
976 """
977
978 de_inst = DebuggerInstance(trans_id)
979 if de_inst.debugger_data is None:
980 return make_json_response(
981 data={
982 'status': False,
983 'result': SERVER_CONNECTION_CLOSED
984 }
985 )
986
987 manager = get_driver(PG_DEFAULT_DRIVER).connection_manager(
988 de_inst.debugger_data['server_id'])
989 conn = manager.connection(
990 did=de_inst.debugger_data['database_id'],
991 conn_id=de_inst.debugger_data['conn_id'])
992
993 if conn.connected():
994 # Update the session variable "restart_debug" to know that same
995 # function debugging has been restarted. Delete the existing debugger
996 # data in session variable and update with new data
997 if de_inst.debugger_data['restart_debug'] == 0:
998 de_inst.debugger_data['restart_debug'] = 1
999 de_inst.update_session()
1000
1001 de_inst.function_data.update({
1002 'server_id': de_inst.debugger_data['server_id'],
1003 'database_id': de_inst.debugger_data['database_id'],
1004 'schema_id': de_inst.debugger_data['schema_id'],
1005 'function_id': de_inst.debugger_data['function_id'],
1006 'trans_id': str(trans_id),
1007 'proargmodes': de_inst.function_data['arg_mode'],
1008 'proargtypenames': de_inst.function_data['args_type'],
1009 'pronargdefaults': de_inst.function_data['use_default'],
1010 'proargdefaults': de_inst.function_data['default_value'],
1011 'proargnames': de_inst.function_data['args_name'],
1012 'require_input': de_inst.function_data['require_input']
1013 })
1014
1015 return make_json_response(
1016 data={
1017 'status': True, 'restart_debug': True,
1018 'result': de_inst.function_data
1019 }
1020 )
1021 else:
1022 status = False
1023 result = SERVER_CONNECTION_CLOSED
1024 return make_json_response(data={'status': status, 'result': result})

Callers

nothing calls this directly

Calls 8

update_sessionMethod · 0.95
DebuggerInstanceClass · 0.90
make_json_responseFunction · 0.90
get_driverFunction · 0.90
connection_managerMethod · 0.80
connectionMethod · 0.80
connectedMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected