- 大小预检此前对 adoc/axls 也用目录大小,而在线文档目录大小是容器大小 (实测有 1.40GB 的 adoc,导出 docx 仅 49.5MB)→ 3 个可导出文档被误判 over_limit - axls 转换器的 dws 失败改为抛 DwsCallError,取件器映射成平台错误码 (此前进程无结果退出,平台只看到 artifact_fetch_no_output) - export_failed 改判 retryable:8 路混合时巨型文档服务端导出偶发失败,1/2/4 路与串行必成 - 新增 2 个回归测试 + dws_error_map 1 个断言;文档补并发实测表与回归清单
This commit is contained in:
@@ -466,10 +466,6 @@ def _dws_inspect_extension(raw_key):
|
||||
def dingtalk_dws_download(manifest, max_bytes):
|
||||
"""Fetch one DingTalk node through dws: adoc -> docx export, axls -> converted
|
||||
xlsx, everything else -> raw drive download. Returns (path, size, digest, matched_local)."""
|
||||
catalog_size = manifest.get("size_bytes")
|
||||
if isinstance(catalog_size, int) and catalog_size > max_bytes:
|
||||
# The catalog already knows the size: refuse before burning a download.
|
||||
raise FetchError("artifact exceeds ingest size limit", retryable=False, code="over_limit")
|
||||
raw_key, _dentry_type = dingtalk_raw_keys(manifest)
|
||||
# The node type comes from the RESOLVED name suffix first (that is what the legacy
|
||||
# path keys on); declared_type is an optional hint and dingtalk_raw_keys returns a
|
||||
@@ -480,6 +476,14 @@ def dingtalk_dws_download(manifest, max_bytes):
|
||||
declared = (manifest.get("declared_type") or "").lower()
|
||||
extension = declared if declared not in ("", "file", "folder") else _dws_inspect_extension(raw_key)
|
||||
extension = (extension or "").lower().lstrip(".")
|
||||
# Catalog size is only a true byte count for ORDINARY files. For online documents
|
||||
# (adoc/axls/able/...) the catalog size is the container size, which can exceed the
|
||||
# cap while the exported docx/xlsx stays small — pre-checking those would wrongly
|
||||
# reject documents that the legacy path exported happily.
|
||||
online_document = extension in ("adoc", "axls", "able", "appt", "amind", "adraw")
|
||||
catalog_size = manifest.get("size_bytes")
|
||||
if not online_document and isinstance(catalog_size, int) and catalog_size > max_bytes:
|
||||
raise FetchError("artifact exceeds ingest size limit", retryable=False, code="over_limit")
|
||||
if extension in ("dlink", "hlink"):
|
||||
raise MissingSource("DingTalk link node has no bytes (fileSize=0)")
|
||||
if extension in ("amind", "appt"):
|
||||
@@ -494,7 +498,13 @@ def dingtalk_dws_download(manifest, max_bytes):
|
||||
raise _dws_error(verdict)
|
||||
elif extension == "axls":
|
||||
target = "out.xlsx"
|
||||
axls_to_xlsx.build_xlsx(axls_to_xlsx.fetch_sheets(raw_key), str(workdir / target))
|
||||
try:
|
||||
axls_to_xlsx.build_xlsx(axls_to_xlsx.fetch_sheets(raw_key), str(workdir / target))
|
||||
except axls_to_xlsx.DwsCallError as error:
|
||||
# Map the converter's dws failure onto the platform contract instead of
|
||||
# letting the process die without a result (the Go runner would then only
|
||||
# see "artifact_fetch_no_output").
|
||||
raise _dws_error(dws_error_map.classify({"error": {"message": str(error)}}))
|
||||
else:
|
||||
target = "out." + (extension or "bin")
|
||||
_, verdict = dws_run(["drive", "+download", "--node", raw_key, "--output", target],
|
||||
|
||||
Reference in New Issue
Block a user