收紧生成任务轮询与资产读取路径
空生成任务列表不再保持四秒轮询 读取资源字节优先通过read-url直连OSS 保留read-bytes作为OSS读取失败兜底 更新资产导出与项目记忆文档口径
This commit is contained in:
@@ -4,6 +4,7 @@ import { createMiniGameDraftGenerationState } from '../../services/miniGameDraft
|
||||
import {
|
||||
buildExternalGenerationQueuePresentation,
|
||||
buildExternalGenerationQueueStatus,
|
||||
shouldUseFastExternalGenerationTaskPolling,
|
||||
} from './platformExternalGenerationQueueStatusModel';
|
||||
import {
|
||||
resolveFinishedMiniGameDraftGenerationState,
|
||||
@@ -129,4 +130,50 @@ describe('buildExternalGenerationQueueStatus', () => {
|
||||
}).shouldShow,
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
test('只在队列活跃或存在未确认终态任务时使用快速轮询', () => {
|
||||
expect(
|
||||
shouldUseFastExternalGenerationTaskPolling({
|
||||
pendingCount: 0,
|
||||
runningCount: 0,
|
||||
unacknowledgedTerminalCount: 0,
|
||||
tasks: [],
|
||||
}),
|
||||
).toBe(false);
|
||||
|
||||
expect(
|
||||
shouldUseFastExternalGenerationTaskPolling({
|
||||
currentStatus: 'queued',
|
||||
pendingCount: 0,
|
||||
runningCount: 0,
|
||||
unacknowledgedTerminalCount: 0,
|
||||
tasks: [],
|
||||
}),
|
||||
).toBe(true);
|
||||
|
||||
expect(
|
||||
shouldUseFastExternalGenerationTaskPolling({
|
||||
pendingCount: 0,
|
||||
runningCount: 0,
|
||||
unacknowledgedTerminalCount: 0,
|
||||
tasks: [
|
||||
{
|
||||
jobId: 'extgen-completed',
|
||||
jobKind: 'editor_image_generation',
|
||||
sourceModule: 'editor',
|
||||
sourceEntityId: 'project-1',
|
||||
requestLabel: '图片生成',
|
||||
status: 'completed',
|
||||
phaseLabel: '已完成',
|
||||
phaseDetail: '已完成',
|
||||
progress: 100,
|
||||
priceMudPoints: 1,
|
||||
createdAt: '2026-06-25T00:00:00.000Z',
|
||||
updatedAt: '2026-06-25T00:00:00.000Z',
|
||||
updatedAtMicros: 1_782_348_800_000_000,
|
||||
},
|
||||
],
|
||||
}),
|
||||
).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user