generated from ttipo/project-base
fix(backend): 빈 DB 에서 코스 생성 실행기의 기동 정리가 e2e 를 멈추게 하던 문제 수정
CI (Flutter) / Flutter (analyze · test) (pull_request) Successful in 21m7s
CI / Backend (lint · test · e2e · build) (pull_request) Successful in 12m54s
CI / Frontend (lint · type-check · test) (pull_request) Successful in 11m31s
CI / 에러 코드 SSOT 동기화 검사 (pull_request) Successful in 11m47s
CI (Flutter) / Flutter (analyze · test) (push) Successful in 20m20s
CI / Frontend (lint · type-check · test) (push) Successful in 11m31s
CI / Backend (lint · test · e2e · build) (push) Successful in 12m46s
CI / 에러 코드 SSOT 동기화 검사 (push) Successful in 11m53s
CI (Flutter) / Flutter (analyze · test) (pull_request) Successful in 21m7s
CI / Backend (lint · test · e2e · build) (pull_request) Successful in 12m54s
CI / Frontend (lint · type-check · test) (pull_request) Successful in 11m31s
CI / 에러 코드 SSOT 동기화 검사 (pull_request) Successful in 11m47s
CI (Flutter) / Flutter (analyze · test) (push) Successful in 20m20s
CI / Frontend (lint · type-check · test) (push) Successful in 11m31s
CI / Backend (lint · test · e2e · build) (push) Successful in 12m46s
CI / 에러 코드 SSOT 동기화 검사 (push) Successful in 11m53s
CI 의 빈 DB 에서 e2e 가 앱을 띄운 뒤에 마이그레이션을 돌려, 실행기의 기동 정리가 아직 없는 테이블을 찾다가 기동이 실패했다. 앱을 닫지 못해 1분 주기 정리 작업이 남아 jest 가 끝나지 않았고 CI 가 러너 제한 시간까지 멈춰 있었다. - 기동 정리는 실패해도 기동을 막지 않고 error 로그만 남긴다 - 앱 전체를 띄우는 e2e 는 운영처럼 마이그레이션을 먼저 돌린다 - 준비가 실패해도 afterAll 에서 앱을 반드시 닫는다 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit was merged in pull request #13.
This commit is contained in:
@@ -54,15 +54,24 @@ export class CourseGenerationRunner
|
||||
private readonly pipeline: CourseGenerationPipeline,
|
||||
) {}
|
||||
|
||||
/** 서버가 한 대라 기동할 때 남아 있는 작업은 모두 지난 프로세스의 것이다 */
|
||||
/**
|
||||
* 서버가 한 대라 기동할 때 남아 있는 작업은 모두 지난 프로세스의 것이다.
|
||||
* 정리일 뿐이라 실패해도 기동은 막지 않는다 — 마이그레이션 전이라 테이블이 없을 때 서버 전체가 뜨지 않았다(2026-11-11)
|
||||
*/
|
||||
async onApplicationBootstrap(): Promise<void> {
|
||||
const result = await this.generations.update(
|
||||
{ status: In([...ACTIVE_STATUSES]) },
|
||||
this.failedValues(),
|
||||
);
|
||||
if (result.affected) {
|
||||
this.logger.warn(
|
||||
`지난 실행에서 끝나지 못한 코스 생성 ${result.affected}건을 실패로 바꿨다`,
|
||||
try {
|
||||
const result = await this.generations.update(
|
||||
{ status: In([...ACTIVE_STATUSES]) },
|
||||
this.failedValues(),
|
||||
);
|
||||
if (result.affected) {
|
||||
this.logger.warn(
|
||||
`지난 실행에서 끝나지 못한 코스 생성 ${result.affected}건을 실패로 바꿨다`,
|
||||
);
|
||||
}
|
||||
} catch (error) {
|
||||
this.logger.error(
|
||||
`[SYS_001] 끝나지 못한 코스 생성을 정리하지 못했다: ${error instanceof Error ? error.message : String(error)}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user