-
Notifications
You must be signed in to change notification settings - Fork 3
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
Conversation
val session = sessionMap[sessionId] | ||
|
||
session?.let { | ||
session.ping = true | ||
} | ||
} |
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.
p3. let 으로 null check 하는 것은 권장하지 않습니다.
https://tourspace.tistory.com/208
val session = sessionMap[sessionId] | |
session?.let { | |
session.ping = true | |
} | |
} | |
val session = sessionMap[sessionId] ?: return | |
session.ping = true | |
} |
app/websocket/src/main/kotlin/com/xorker/draw/websocket/session/PingManager.kt
Outdated
Show resolved
Hide resolved
# Conflicts: # app/websocket/src/main/kotlin/com/xorker/draw/websocket/session/SessionManager.kt
} | ||
|
||
companion object { | ||
private const val ALLOWED_DELAY_TIME = 2 |
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.
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 |
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.
p4. Session Not Found Exception 등을 새로만드는게 어떨까요?
Related Jira ✔
Description ✔
PR Rule ✔
P1: 꼭 반영해주세요 (Request changes)
P2: 적극적으로 고려해주세요 (Request changes)
P3: 웬만하면 반영해 주세요 (Comment)
P4: 반영해도 좋고 넘어가도 좋습니다 (Approve)
P5: 그냥 사소한 의견입니다 (Approve)