[DP-481] 모의면접 finalize AI 호출 비동기 분리 — 504 Timeout 해결#169
Merged
nYeonG4001 merged 3 commits intoMay 12, 2026
Conversation
- MockInterviewStatus에 PROCESSING 상태 추가 - MockInterviewFinalizeService: @async + @TransactionalEventListener(AFTER_COMMIT)로 finalizeMockInterview AI 호출 비동기 처리 (히스토리·포인트 적립 포함) - MockInterviewService: finalizeSession 제거, 마지막 문항/조기종료 시 PROCESSING 상태 저장 후 MockInterviewFinalizeEvent 발행으로 즉시 응답 반환 - AsyncConfig: mockInterviewFinalizeExecutor 스레드풀 설정 - 테스트: MockInterviewFinalizeServiceTest(9개), MockInterviewServiceTest(5개) 작성
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
finalizeMockInterview)을 트랜잭션 커밋 후 별도 스레드에서 비동기 처리PROCESSING추가로 프론트가 결과 생성 진행 중임을 구분 가능변경 사항
MockInterviewStatus—PROCESSINGenum 값 추가 (IN_PROGRESS→PROCESSING→COMPLETED/EARLY_FINISHED)MockInterviewFinalizeEvent— 이벤트 레코드 신규 생성MockInterviewFinalizeService—@Async+@TransactionalEventListener(AFTER_COMMIT)리스너로 finalize 로직 분리 (히스토리·포인트 기록 포함)MockInterviewService— finalize 관련 로직 제거,ApplicationEventPublisher로 이벤트 발행AsyncConfig—mockInterviewFinalizeExecutorThreadPoolTaskExecutor 등록 (@EnableAsync)백엔드 상태 변화:
IN_PROGRESSPROCESSINGCOMPLETEDEARLY_FINISHEDMockInterviewResult.tsx수정 요청:resultJson이 null이고 세션 상태가PROCESSING이면 로딩 UI 표시 후 polling (예: 3초 간격GET /mock-interviews/{sessionId})COMPLETED또는EARLY_FINISHED가 되면 polling 중단 후 결과 표시Test
MockInterviewFinalizeServiceTest— 9개 케이스 (FinalizeService coverage 95%)MockInterviewServiceTest— 5개 케이스 (이벤트 발행 검증)Jira
DP-481