mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-09 18:39:04 +08:00
Fix: Missing type check on log queue handler thread
This commit is contained in:
parent
701d4bf955
commit
4d46ab45e8
@ -41,7 +41,7 @@ class ProcessManager:
|
|||||||
self._process.terminate()
|
self._process.terminate()
|
||||||
self.log.append(
|
self.log.append(
|
||||||
f"[{self.config_name}] exited. Reason: Manual stop\n")
|
f"[{self.config_name}] exited. Reason: Manual stop\n")
|
||||||
if self.thd_log_queue_handler.is_alive():
|
if self.thd_log_queue_handler is not None:
|
||||||
self.thd_log_queue_handler.stop()
|
self.thd_log_queue_handler.stop()
|
||||||
logger.info(f"[{self.config_name}] exited")
|
logger.info(f"[{self.config_name}] exited")
|
||||||
|
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
import ctypes
|
import ctypes
|
||||||
import datetime
|
import datetime
|
||||||
import operator
|
import operator
|
||||||
from queue import Queue
|
|
||||||
import re
|
import re
|
||||||
import threading
|
import threading
|
||||||
import time
|
import time
|
||||||
|
from queue import Queue
|
||||||
from typing import Callable, Generator, List
|
from typing import Callable, Generator, List
|
||||||
|
|
||||||
from module.logger import logger
|
from module.logger import logger
|
||||||
@ -36,12 +36,13 @@ class Thread(threading.Thread):
|
|||||||
return thd_id
|
return thd_id
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
thread_id = self._get_id()
|
if self.is_alive():
|
||||||
res = ctypes.pythonapi.PyThreadState_SetAsyncExc(thread_id,
|
thread_id = self._get_id()
|
||||||
ctypes.py_object(SystemExit))
|
res = ctypes.pythonapi.PyThreadState_SetAsyncExc(thread_id,
|
||||||
if res > 1:
|
ctypes.py_object(SystemExit))
|
||||||
ctypes.pythonapi.PyThreadState_SetAsyncExc(thread_id, 0)
|
if res > 1:
|
||||||
print('Exception raise failure')
|
ctypes.pythonapi.PyThreadState_SetAsyncExc(thread_id, 0)
|
||||||
|
logger.error('Exception raise failure')
|
||||||
|
|
||||||
|
|
||||||
class Task:
|
class Task:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user