Skip to content

Conversation

@adorableco
Copy link
Contributor

@adorableco adorableco commented Apr 9, 2025

PR

✨ 작업 내용

  • gradeExam 메서드를 suspend 함수로 전환하고, 전체 로직을 withContext(Dispatchers.IO +CoroutineName("gradeExamV2")) 내부에서 실행되도록 변경했습니다.
  • 각 답안 채점 로직을 async로 병렬 처리한 후, awaitAll()을 통해 구조화된 방식으로 결과를 수집하고 저장하도록 리팩토링했습니다.
  • OpenAI API 요청(gradeByChatGpt)을 명시적으로 withContext(Dispatchers.IO)에서 실행하도록 변경하여, IO 블로킹 작업이 적절한 스레드에서 실행되도록 보장했습니다.
  • CoroutineName을 도입하여 각 채점 코루틴 및 전체 채점 프로세스에 대해 로깅을 강화했습니다.
  • 전체 실행 시간을 측정하여 성능 모니터링이 가능하도록 개선했습니다.

결과

스크린샷 2025-04-09 오후 4 04 32

✨ 참고 사항

  • EC2 인스턴스 내부에 있던 deploy.sh 스크립트 파일을 형상관리를 위해 GitHub에 푸시하겠습니다.
  • 이외의 모든 변경파일은 KtlintFormat에 맞춰 변경된 파일입니다.

⏰ 현재 버그

x


✏ Git Close

@adorableco adorableco added ✨ Feature 기능 개발 🔨 Refactor 코드 리팩토링 labels Apr 9, 2025
@adorableco adorableco requested a review from Copilot April 9, 2025 07:23
@adorableco adorableco self-assigned this Apr 9, 2025
@adorableco adorableco linked an issue Apr 9, 2025 that may be closed by this pull request
1 task
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 9 out of 11 changed files in this pull request and generated no comments.

Files not reviewed (2)
  • .editorconfig: Language not supported
  • scripts/deploy.sh: Language not supported
Comments suppressed due to low confidence (2)

src/main/kotlin/com/swm_standard/phote/service/ExamService.kt:228

  • Logger context extraction should use 'coroutineContext[CoroutineName.Key]' for consistency with other log messages.
logger.info { "[${coroutineContext[CoroutineName]}] : gradeExam 종료" }

src/main/kotlin/com/swm_standard/phote/service/ExamService.kt:369

  • [nitpick] Consider replacing the hard-coded '###########' with a dynamic value (e.g. using 'coroutineContext[CoroutineName.Key]') for consistent and meaningful logging.
logger.info { "[CoroutineName(###########)][answer: ${index + 1}] : gradeAnswer 종료" }

@adorableco adorableco force-pushed the seyeon/swm-205 branch 2 times, most recently from a8666bc to ec907a0 Compare April 9, 2025 07:53
@github-actions
Copy link

github-actions bot commented Apr 9, 2025

테스트 커버리지 측정

File Coverage [92.86%] 🍏
Answer.kt 92.86% 🍏
Total Project Coverage 79.53% 🍏

@adorableco adorableco merged commit ecf9489 into develop Apr 9, 2025
1 of 3 checks passed
@adorableco adorableco deleted the seyeon/swm-205 branch April 9, 2025 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ Feature 기능 개발 🔨 Refactor 코드 리팩토링

Projects

None yet

Development

Successfully merging this pull request may close these issues.

✨ Feat: gradeExam coroutine 개선

2 participants