perf(storage): 拦截任务二进制并本地暂存结果

原因:任务标准结果中的 Base64、Data URI 和 Buffer 会进入 PostgreSQL JSON,导致 TOAST 与备份体积快速增长。

影响:新增统一 JSON 持久化关口;upload_none 将二进制原子写入本地结果目录,数据库仅保存带 SHA-256 的有界占位符;任务详情、同步响应、异步查询和兼容协议按需校验恢复。补充 24 小时清理、容量上限、历史小批量治理命令及管理端说明。

风险:本地结果超过 TTL、丢失或损坏时分别返回明确的 410/500;空间不足时返回 503 且不重试上游。未自动执行历史治理。

验证:三种真实图片模型同步/异步与幂等重放通过;Go vet/全量测试、前端 111 测试、lint/typecheck/build、OpenAPI、迁移安全、govulncheck、依赖审计、手工发布测试及 Linux amd64 构建通过。
This commit is contained in:
2026-07-24 21:13:09 +08:00
parent 2457de6a56
commit 4f163ea6d7
31 changed files with 2067 additions and 30 deletions
+44
View File
@@ -4738,6 +4738,12 @@
"schema": {
"$ref": "#/definitions/httpapi.EasyAIGeneratedResponse"
}
},
"410": {
"description": "Gone",
"schema": {
"$ref": "#/definitions/httpapi.EasyAIGeneratedResponse"
}
}
}
}
@@ -5645,6 +5651,12 @@
"schema": {
"$ref": "#/definitions/httpapi.VolcesErrorEnvelope"
}
},
"410": {
"description": "Gone",
"schema": {
"$ref": "#/definitions/httpapi.VolcesErrorEnvelope"
}
}
}
},
@@ -6304,6 +6316,13 @@
"type": "object",
"additionalProperties": true
}
},
"410": {
"description": "Gone",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
@@ -6404,6 +6423,13 @@
"type": "object",
"additionalProperties": true
}
},
"410": {
"description": "Gone",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
},
@@ -7883,6 +7909,12 @@
"$ref": "#/definitions/httpapi.ErrorEnvelope"
}
},
"410": {
"description": "Gone",
"schema": {
"$ref": "#/definitions/httpapi.ErrorEnvelope"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
@@ -8305,6 +8337,12 @@
"$ref": "#/definitions/httpapi.KelingCompatibleEnvelope"
}
},
"410": {
"description": "Gone",
"schema": {
"$ref": "#/definitions/httpapi.KelingCompatibleEnvelope"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
@@ -8766,6 +8804,12 @@
"$ref": "#/definitions/httpapi.ErrorEnvelope"
}
},
"410": {
"description": "Gone",
"schema": {
"$ref": "#/definitions/httpapi.ErrorEnvelope"
}
},
"500": {
"description": "Internal Server Error",
"schema": {