mirror of
https://github.com/ParisNeo/lollms-webui.git
synced 2025-02-21 01:31:20 +00:00
added thread deletion
This commit is contained in:
parent
0db1fb7d8c
commit
75aa6afc98
@ -47,6 +47,8 @@ def terminate_thread(thread):
|
||||
res = ctypes.pythonapi.PyThreadState_SetAsyncExc(thread_id, exc)
|
||||
if res > 1:
|
||||
ctypes.pythonapi.PyThreadState_SetAsyncExc(thread_id, None)
|
||||
del thread
|
||||
gc.collect()
|
||||
raise SystemError("Failed to terminate the thread.")
|
||||
else:
|
||||
ASCIIColors.yellow("Canceled successfully")
|
||||
|
Loading…
x
Reference in New Issue
Block a user