-
Notifications
You must be signed in to change notification settings - Fork 1
[BE-FIX] sync_token 만료 시 재시도하지 않도록 수정 #407
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
base: dev
Are you sure you want to change the base?
Conversation
WalkthroughThe changes update the handling of the Changes
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📥 CommitsReviewing files that changed from the base of the PR and between 74fa133318be280b9633f48e944561879f7b32e8 and 61d84fb. 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (2)
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Join our Discord community for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
just ask; 클라이언트가 에러 응답을 보고 다시 요청을 보내는건가요? |
날리도록 수정 - 예외를 날린 후 구글 서버에 500 에러 응답을 보낸다. - 500응답을 받은 구글 서버가 웹훅 알림을 한 번 더 보낸다. - 이때 다시 일정을 가져오면서 sync_token을 업데이트한다.
- sync_token이 유효하지 않을 경우 재시도 하지 않고 예외를 발생 시키는 것으로 수정
- 람다 함수 내부에서 url을 생성하도록 수정
74fa133 to
61d84fb
Compare
로그인할 때 실행되는 것을 파악하지 못했습니다. |
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.
getSyncToken을 재시도하는 이유가 뭘까요?
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.
요약: syncToken이 만료되었을 때 전체 일정을 가져오는 URL을 새로 생성하기 위해 사용합니다.
129번째 줄에서 url을 생성할 때 syncToken이 있다면 URL 쿼리에 syncToken을 추가하고 null 이라면 추가하지 않은(전체 일정을 가져오는) url을 생성합니다.
만약 API를 요청할 때 syncToken이 만료되거나 유효하지 않다면, RetryExecutor에서 DB의 syncToken을 null로 설정합니다. 그 이후에 재시도할 때는 이전에 사용한 URL이 아닌 syncToken이 포함되지 않은(전체 일정을 가져오는) URL로 재시도해야 합니다.
이전 코드를 보면 eventsUrl을 람다 함수 밖에서 만들어서 주입해주고 있는데요. 따로 조사한 결과, 람다 함수 외부에서 주입된 변수는 final로 처리되어 수정이 되지 않는다고 합니다. 따라서 새로 생성한 url을 적용하기 위해서 람다 함수 내부에서 url을 생성하기 위해 url 생성 과정에 필요한 getSyncToken을 재시도하고 있습니다.!
#️⃣ 연관된 이슈>
📝 작업 내용> 이번 PR에서 작업한 내용을 간략히 설명해주세요(이미지 첨부 가능)
구글 캘린더 일정과 서비스 일정을 동기화할 때 사용하는 sync_token이 만료되는 경우입니다.만료되는 경우 sync_token만 재발급 받을 수 없기 때문에 일정들을 모두 가져오는 API를 사용해서 sync_token을 새로 업데이트 해야 합니다.이전에는 sync_token이 만료되는 경우에 3번 재시도를 하였습니다.이러한 재시도는 만료된 sync_token을 사용한 재시도이기 때문에 불필요합니다.따라서 재시도 없이 바로 예외를 발생시켜 일정을 다시 가져오는 API를 사용하도록 변경합니다.🙏 여기는 꼭 봐주세요! > 리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요
Summary by CodeRabbit
Bug Fixes
Tests