Skip to content

Conversation

@seop-h
Copy link
Contributor

@seop-h seop-h commented Jan 7, 2025

변경 사항

1. 'AI 질문 생성기' API 생성

  • CLOVA Studio에서 모델을 튜닝하여, 키워드를 포함한 인풋을 넣으면 적절한 질문을 만들어주는 작업을 생성했습니다.
    image
  • 우선 해당 작업을 테스트 앱으로 등록해서 API로 사용할 수 있도록 했고, QA 환경에서는 이 테스트 앱을 사용하다가 이후 실제 서비스 앱으로 신청할 예정입니다.

2. 매일 자정에 AI 질문을 생성하는 기능 추가

  • 매일 자정마다 AI 질문 생성기에 요청을 보내는 코드를 추가했습니다.
  • 스케줄러가 동작하는 환경을 멀티 스레드로 구현해서, 혹시라도 있을지 모르는 AlarmService.sendHeartbeat()와의 충돌을 방지했습니다.

@seop-h seop-h self-assigned this Jan 7, 2025
Comment on lines +8 to +14
/**
* Spring Scheduler 는 기본적으로 싱글 스레드도 동작.
* 그러나 이 애플리케이션에서 사용하는 스케줄러는 현재 두 개
* : AiQuestionCreationService.makeTodayAiQuestion(), AlarmService.sendHeartbeat()
* 확률이 매우 낮긴 하지만 이 두 스케줄러가 동시에 실행될 때, 싱글 스레드 환경이라면 예상과는 다르게 동작할 수도 있음.
* 따라서 스케줄링 작업에 할당할 스레드를 3개로 지정해, 하나의 스케줄러가 다른 것에 영향을 미치치 않도록 멀티 스레드 환경을 구축
*/
Copy link
Contributor

@rodom1018 rodom1018 Jan 7, 2025

Choose a reason for hiding this comment

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

단일 스레드로 하면 첫 번째 작업이 완료될 때까지 두 번째 작업은 대기한다고 해서 큰 영향은 없을 거 같긴 합니다. 그래도 스레드화 한게 신기하네요 ㅋㅋ

하트비트는 사실 제 생각엔 지워도 되긴 한데 .... (<- 크롬 창 내리면 어차피 sse 연결 끊겨서 sse 연결 시간 연장에 큰 의미가 없더라고요)
혹시 모르니 6시간 주기로 올려 놓을 게요.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

넵 알겠습니다!

저도 사실 멀티 스레드 그냥 멋있어 보여서 추가한 게 더 큽니다ㅎㅎㅎ

@seop-h seop-h merged commit 0fdccd2 into woozuda:develop Jan 8, 2025
1 check passed
@seop-h seop-h deleted the feature/question-creation branch January 8, 2025 03:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants