-
Notifications
You must be signed in to change notification settings - Fork 2
AI 질문 생성 스케줄러 추가 #111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AI 질문 생성 스케줄러 추가 #111
Conversation
| /** | ||
| * Spring Scheduler 는 기본적으로 싱글 스레드도 동작. | ||
| * 그러나 이 애플리케이션에서 사용하는 스케줄러는 현재 두 개 | ||
| * : AiQuestionCreationService.makeTodayAiQuestion(), AlarmService.sendHeartbeat() | ||
| * 확률이 매우 낮긴 하지만 이 두 스케줄러가 동시에 실행될 때, 싱글 스레드 환경이라면 예상과는 다르게 동작할 수도 있음. | ||
| * 따라서 스케줄링 작업에 할당할 스레드를 3개로 지정해, 하나의 스케줄러가 다른 것에 영향을 미치치 않도록 멀티 스레드 환경을 구축 | ||
| */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
단일 스레드로 하면 첫 번째 작업이 완료될 때까지 두 번째 작업은 대기한다고 해서 큰 영향은 없을 거 같긴 합니다. 그래도 스레드화 한게 신기하네요 ㅋㅋ
하트비트는 사실 제 생각엔 지워도 되긴 한데 .... (<- 크롬 창 내리면 어차피 sse 연결 끊겨서 sse 연결 시간 연장에 큰 의미가 없더라고요)
혹시 모르니 6시간 주기로 올려 놓을 게요.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
넵 알겠습니다!
저도 사실 멀티 스레드 그냥 멋있어 보여서 추가한 게 더 큽니다ㅎㅎㅎ
변경 사항
1. 'AI 질문 생성기' API 생성
2. 매일 자정에 AI 질문을 생성하는 기능 추가
AlarmService.sendHeartbeat()와의 충돌을 방지했습니다.