diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 453a226..6560421 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -295,7 +295,7 @@ jobs: # Job 4: M-AI-03 Synthetic E2E # ═══════════════════════════════════════════════════════════ m-ai-03-synthetic-e2e: - needs: current-integration + needs: build-and-unit runs-on: prod steps: - name: Restore build artifacts @@ -309,6 +309,12 @@ jobs: docker start mysql redis 2>/dev/null || true sleep 2 + - name: Apply database migrations + run: | + cd $WORKDIR + DATABASE_URL="${{ secrets.DATABASE_URL }}" npx prisma migrate deploy + timeout-minutes: 5 + - name: M-AI-03 Gate E2E run: | cd $WORKDIR diff --git a/src/modules/ai-job/ai-job-creation.service.ts b/src/modules/ai-job/ai-job-creation.service.ts index 34df2c8..b133dfc 100644 --- a/src/modules/ai-job/ai-job-creation.service.ts +++ b/src/modules/ai-job/ai-job-creation.service.ts @@ -73,13 +73,16 @@ export class AiJobCreationService { // 3. Build snapshot(事务外:依赖外部 DB 读取,不应占用事务时间) // Admin Retry 可传入预构建的 snapshot content(复用原 Snapshot 内容) + // synthetic_job 跳过真实 snapshot(不需要真实用户数据表) const snapshot = input.retrySnapshotContent ? input.retrySnapshotContent - : await this.snapshotBuilder.buildSnapshot( - input.userId, - input.targetType, - input.targetId, - ); + : input.jobType === 'synthetic_job' + ? { _synthetic: true, targetType: input.targetType, targetId: input.targetId } + : await this.snapshotBuilder.buildSnapshot( + input.userId, + input.targetType, + input.targetId, + ); const contentHash = this.computeHash(JSON.stringify(snapshot));