mirror of
https://github.com/JefferyHcool/BiliNote.git
synced 2026-06-01 14:39:34 +08:00
🐞 fix: 增加错误之后对已解析段落的缓存功能,再次重试时不再重头开始
解析长视频时,当附件大小过大时不再调用后进行报错,而是将附件进行分批次发送 在每篇笔记开头默认增加地址来源链接,对模糊处可溯源
This commit is contained in:
14
backend/app/services/task_serial_executor.py
Normal file
14
backend/app/services/task_serial_executor.py
Normal file
@@ -0,0 +1,14 @@
|
||||
import threading
|
||||
from typing import Any, Callable
|
||||
|
||||
|
||||
class SerialTaskExecutor:
|
||||
def __init__(self):
|
||||
self._lock = threading.Lock()
|
||||
|
||||
def run(self, fn: Callable[..., Any], *args: Any, **kwargs: Any) -> Any:
|
||||
with self._lock:
|
||||
return fn(*args, **kwargs)
|
||||
|
||||
|
||||
task_serial_executor = SerialTaskExecutor()
|
||||
Reference in New Issue
Block a user