Skip to content

Commit e6acba1

Browse files
author
Jongmin Kim
committed
refactor: change transaction deletion logic
1 parent ea6d6bb commit e6acba1

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/spaceone/core/transaction.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,5 +134,7 @@ def delete_transaction() -> None:
134134
if transaction := get_transaction(is_create=False):
135135
if hasattr(LOCAL_STORAGE, transaction.id):
136136
delattr(LOCAL_STORAGE, transaction.id)
137-
elif hasattr(LOCAL_STORAGE, transaction.thread_id):
138-
delattr(LOCAL_STORAGE, transaction.thread_id)
137+
138+
thread_id = str(threading.current_thread().ident)
139+
if hasattr(LOCAL_STORAGE, thread_id):
140+
delattr(LOCAL_STORAGE, thread_id)

0 commit comments

Comments
 (0)