fix(contract): 优化合同审核方案

(cherry picked from commit bdb2c3113efe87604244a24258cd973955dce544)
This commit is contained in:
sophie committed 2026-08-05 10:20:31 +08:00
1 parent 6b96d5a14f
commit 9bcbf9d211
14 files changed
+2717 -87

No files matched your search

@@ -21,6 +21,7 @@ from typing import Any
from flask import current_app
from minio import Minio
from minio.error import S3Error
_LOGGER = logging.getLogger(__name__)
@@ -188,6 +189,17 @@ def restore_review_artifact(review_no: str, relative_path: str) -> Path | None:
finally:
response.close()
response.release_conn()
except S3Error as exc:
if exc.code == "NoSuchKey":
# [STEP 1] 审核执行中可选 OCR 坐标不存在时,归档尚未提交属于预期状态,不刷告警。
_LOGGER.debug(
"[contract-review] artifact manifest not ready review_no=%s path=%s",
review_no,
relative,
)
return None
_LOGGER.warning("[contract-review] artifact restore failed review_no=%s path=%s err=%s", review_no, relative, exc)
return None
except Exception as exc:
_LOGGER.warning("[contract-review] artifact restore failed review_no=%s path=%s err=%s", review_no, relative, exc)
return None