diff --git a/app/websocket/src/main/kotlin/com/xorker/draw/websocket/MainWebSocketHandler.kt b/app/websocket/src/main/kotlin/com/xorker/draw/websocket/MainWebSocketHandler.kt index 386a2804..25572282 100644 --- a/app/websocket/src/main/kotlin/com/xorker/draw/websocket/MainWebSocketHandler.kt +++ b/app/websocket/src/main/kotlin/com/xorker/draw/websocket/MainWebSocketHandler.kt @@ -19,6 +19,7 @@ internal class MainWebSocketHandler( private val waitingQueueSessionUseCase: WaitingQueueSessionUseCase, private val router: WebSocketRouter, private val requestParser: WebSocketRequestParser, + private val waitingQueueSessionEventListener: List, private val sessionEventListener: List, private val webSocketExceptionHandler: WebSocketExceptionHandler, private val metricManager: MetricManager, @@ -51,7 +52,9 @@ internal class MainWebSocketHandler( val waitingQueueSessionDto = waitingQueueSessionUseCase.getSession(SessionId(session.id)) if (waitingQueueSessionDto != null) { - waitingQueueSessionUseCase.unregisterSession(SessionId(session.id)) + waitingQueueSessionEventListener.forEach { + it.exitSession(waitingQueueSessionDto) + } return }