feat(file): allow immediate retry during export backoff

This commit is contained in:
2026-09-03 10:39:55 +08:00
parent 16a60a9175
commit 6b2339e50a
5 changed files with 78 additions and 1 deletions
@@ -19,8 +19,27 @@ paths:
application/json:
schema: {$ref: '#/components/schemas/CreateDomesticOrderExportTask'}
responses:
'200': {description: 返回异步任务,初始状态 PENDING}
'200':
description: 返回异步任务,初始状态 PENDING
content:
application/json:
schema: {$ref: '#/components/schemas/ExportTaskRetryState'}
'403': {description: 缺少 platform:order:export}
/api/platform/v1/files/export-tasks/{taskId}/retry:
post:
summary: 人工重试订单导出任务
description: >-
FAILED 任务重新开始一次执行;PENDING 且已自动失败过的退避任务立即到期并复用当前投递消息,
不新增并发任务。RUNNING、初次等待消费及已完成任务不允许重复重试。
parameters:
- {name: taskId, in: path, required: true, schema: {type: string, pattern: '^[1-9][0-9]*$'}}
responses:
'200':
description: 返回已重新进入立即执行队列的任务
content:
application/json:
schema: {$ref: '#/components/schemas/ExportTaskRetryState'}
'409': {description: 任务当前状态不允许重试或已进入执行队列}
/api/platform/v1/files/export-tasks/{taskId}/download:
get:
summary: 下载本人已完成的订单导出文件
@@ -37,6 +56,16 @@ paths:
schema: {type: string, format: binary}
components:
schemas:
ExportTaskRetryState:
type: object
required: [id, status, attemptCount, maxAttempts]
properties:
id: {type: string, pattern: '^[1-9][0-9]*$'}
status: {type: string, enum: [PENDING, RUNNING, SUCCEEDED, FAILED, EXPIRED]}
failureMessage: {type: string, nullable: true}
attemptCount: {type: integer, minimum: 0}
maxAttempts: {type: integer, minimum: 1}
nextRetryAt: {type: string, format: date-time, nullable: true}
CreateDomesticOrderExportTask:
type: object
required: [exportType, format, taskName, parameters]