Skip to content

Commit

Permalink
Fix the query tool issue 'pgAdminThread' object has no attribute 'nat…
Browse files Browse the repository at this point in the history
…ive_id'. #6660
  • Loading branch information
khushboovashi committed Aug 7, 2023
1 parent f399b30 commit 0b7de3c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion web/pgadmin/tools/sqleditor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,9 @@ def poll(trans_id):
is_thread_alive = False
if trans_obj.get_thread_native_id():
for thread in threading.enumerate():
if thread.native_id == trans_obj.get_thread_native_id() and\
_native_id = thread.native_id if hasattr(thread, 'native_id'
) else thread.ident
if _native_id == trans_obj.get_thread_native_id() and\
thread.is_alive():
is_thread_alive = True
break
Expand Down
4 changes: 3 additions & 1 deletion web/pgadmin/tools/sqleditor/utils/start_running_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,9 @@ def asyn_exec_query(conn, sql, trans_obj, is_rollback_req,
current_app._get_current_object())
)
_thread.start()
trans_obj.set_thread_native_id(_thread.native_id)
_native_id = _thread.native_id if hasattr(_thread, 'native_id'
) else _thread.ident
trans_obj.set_thread_native_id(_native_id)
StartRunningQuery.save_transaction_in_session(session_obj,
trans_id, trans_obj)

Expand Down

0 comments on commit 0b7de3c

Please sign in to comment.