Skip to content
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

DRAW-334 Ping 기반 Health Check 웹소켓 세션 상태 관리 #102

Merged
merged 7 commits into from
Sep 28, 2024

Conversation

SunwoongH
Copy link
Member

Related Jira ✔

Description ✔

PR Rule ✔

P1: 꼭 반영해주세요 (Request changes)
P2: 적극적으로 고려해주세요 (Request changes)
P3: 웬만하면 반영해 주세요 (Comment)
P4: 반영해도 좋고 넘어가도 좋습니다 (Approve)
P5: 그냥 사소한 의견입니다 (Approve)

@SunwoongH SunwoongH self-assigned this Sep 23, 2024
Comment on lines 42 to 47
val session = sessionMap[sessionId]

session?.let {
session.ping = true
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

p3. let 으로 null check 하는 것은 권장하지 않습니다.
https://tourspace.tistory.com/208

Suggested change
val session = sessionMap[sessionId]
session?.let {
session.ping = true
}
}
val session = sessionMap[sessionId] ?: return
session.ping = true
}

@comforest comforest changed the base branch from feature/DRAW-347 to develop September 23, 2024 14:52
@comforest comforest changed the base branch from develop to feature/DRAW-347 September 23, 2024 14:52
}

companion object {
private const val ALLOWED_DELAY_TIME = 2
Copy link
Contributor

Choose a reason for hiding this comment

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

p4. 초 단위를 표현하거나 애초에 Duration으로 저장해서 비교 해도 될 것 같아요

Duration이 Comparable을 구현하고 있어서 대소 비교 가 될거에요

@@ -41,4 +46,10 @@ internal class SessionManager(
val session = sessionMap.remove(sessionId) ?: return null
return userIdMap.remove(session.user.id)
}

fun setPing(sessionId: SessionId) {
val session = sessionMap[sessionId] ?: throw UnSupportedException
Copy link
Contributor

Choose a reason for hiding this comment

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

p4. Session Not Found Exception 등을 새로만드는게 어떨까요?

@comforest comforest merged commit 53f118b into feature/DRAW-347 Sep 28, 2024
1 check passed
@comforest comforest deleted the feature/DRAW-334 branch September 28, 2024 14:01
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