Conversation
There was a problem hiding this comment.
Pull Request Overview
This pull request integrates the AXUM framework to add a basic health check API to the project while also setting up the repository link checking functionality.
- Added a health check endpoint ("/check") using AXUM.
- Introduced a TCP listener for AXUM server in main.rs.
- Updated Cargo.toml to include the AXUM dependency.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/main.rs | Added a health check API endpoint and AXUM server setup; potential issue with repository link checking. |
| Cargo.toml | Added the AXUM dependency to support the new API. |
| let _repo_check = check_repository_links(repo_url, interval_duration); | ||
|
|
There was a problem hiding this comment.
The repository link check future is created but not awaited or spawned, which means it won't execute concurrently. Consider using tokio::spawn to run check_repository_links concurrently with the AXUM server.
| let _repo_check = check_repository_links(repo_url, interval_duration); | |
| tokio::spawn(async move { | |
| check_repository_links(repo_url, interval_duration).await; | |
| }); |
There was a problem hiding this comment.
일단 여기 pr에서는 프레임워크 추가하고 간단한 health check api만 추가한거라 check_repository_links 는 다음 pr에서 작업할게욥. 아직 API를 뭘로 할지도 못정했어연
| async fn health_check() -> &'static str { | ||
| "OK" | ||
| } | ||
|
|
There was a problem hiding this comment.
얌마 뭘보고 이 코드가 잘 동작한다고 판단할 수 있겠니 테스트 추가 ㄱㄱ
There was a problem hiding this comment.
테스트 짜려다가 구조를 변경하고 있다 ㅋㅋㅋ
역시 테스트 짜기 어려운 구조는 클린하지 못한 코드라는걸 다시한번 깨닫는,,,
테스트는 다음 PR에서 구조를 변경하면서 추가하도록 하자.
살짝 스포하면 lib.rs를 사용하여 main.rs의 책임을 분리시키고 서버 실행하는 함수를 따로 만들 것이다. (ex. run())
♟️ What’s this PR about?
AXUM 프레임워크를 사용하여 헬스체크 api를 추가하였다.
🔗 Related Issues / PRs
close: #22
프레임워크 선정은 지피티 친구가 도와주었다.
✅ Rust 웹 프레임워크 비교
Queensac 요구사항 분석
🎯 기능:
매일 링크 체크 스케줄링 (배치성)
☁️ 배포:
서버리스를 염두 (AWS Lambda, Cloud Run 등)
🪶 복잡도:
간단함 유지하고 싶고, 서버리스에 최적화된 구조 원함
결론은 ✅ Axum
서버리스 (Lambda) 배포에 바로 맞고, 스케줄링 + API 처리를 같은 코드베이스로 쉽게 처리 가능.
Rust의 현대적 async 스타일 (Tokio 기반)이랑 자연스럽게 맞음. 필요시 OpenAPI, 인증도 확장 가능 (Poem처럼 무겁지 않게)