修复nougat线程锁释放Bug

This commit is contained in:
binary-husky 2023-09-14 15:26:03 +08:00
parent 0937f37388
commit a1cc2f733c

View File

@ -731,9 +731,10 @@ class nougat_interface():
from toolbox import get_log_folder, gen_time_str from toolbox import get_log_folder, gen_time_str
dst = os.path.join(get_log_folder(plugin_name='nougat'), gen_time_str()) dst = os.path.join(get_log_folder(plugin_name='nougat'), gen_time_str())
os.makedirs(dst) os.makedirs(dst)
self.nougat_with_timeout(f'nougat --out "{os.path.abspath(dst)}" "{os.path.abspath(fp)}"', os.getcwd()) self.nougat_with_timeout(f'nougat --out "{os.path.abspath(dst)}" "{os.path.abspath(fp)}"', os.getcwd(), timeout=300)
res = glob.glob(os.path.join(dst,'*.mmd')) res = glob.glob(os.path.join(dst,'*.mmd'))
if len(res) == 0: if len(res) == 0:
self.threadLock.release()
raise RuntimeError("Nougat解析论文失败。") raise RuntimeError("Nougat解析论文失败。")
self.threadLock.release() self.threadLock.release()
return res[0] return res[0]