feat(pre_process_file):解决hxops上传excel行截断的问题,由markdown换为命中更好的key=value的方式;dify同步custom;行间\n\n,数据行单独成块;
This commit is contained in:
1 parent
a18a07ef1a
commit
67d08924a4
25 files changed
+655
-25
No files matched your search
@@ -235,6 +235,8 @@ def _normalize_path_for_match(p: Path | str) -> str:
|
||||
|
||||
|
||||
_WORD_TIMEOUT_EXTS = {".doc", ".docx"}
|
||||
# Excel/CSV are fast and in-process; skip spawn timeout wrapper (macOS/gevent safe).
|
||||
_FAST_PATH_EXTS = {".xlsx", ".xls", ".csv", ".txt", ".md"}
|
||||
|
||||
|
||||
def _parse_timeout_env(name: str, default: str = "0") -> int | None:
|
||||
@@ -248,6 +250,8 @@ def _parse_timeout_env(name: str, default: str = "0") -> int | None:
|
||||
|
||||
def _file_timeout_sec(file_path: Path | None = None) -> int | None:
|
||||
suffix = str(getattr(file_path, "suffix", "") or "").lower()
|
||||
if suffix in _FAST_PATH_EXTS:
|
||||
return None
|
||||
if suffix in _WORD_TIMEOUT_EXTS:
|
||||
specific = _parse_timeout_env("EDKB_WORD_FILE_TIMEOUT_SEC")
|
||||
if specific:
|
||||
|
||||
Reference in new issue
Block a user