mirror of
https://github.com/dalbodeule/chibot-chzzk-bot.git
synced 2025-06-08 23:08:20 +00:00
Handle WebSocket session removal on channel closure
Add `removeSession` calls in WebSocket exception handling blocks to ensure proper session cleanup when a `ClosedReceiveChannelException` occurs. Prevents potential resource leaks and ensures consistency across WebSocket routes.
This commit is contained in:
parent
83cb68b63f
commit
0e8462eaf1
@ -151,6 +151,7 @@ fun Routing.wsSongListRoutes() {
|
||||
}
|
||||
} catch (e: ClosedReceiveChannelException) {
|
||||
logger.error("Error in WebSocket: ${e.message}")
|
||||
removeSession(uid)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -110,6 +110,7 @@ fun Routing.wsSongRoutes() {
|
||||
}
|
||||
} catch(e: ClosedReceiveChannelException) {
|
||||
logger.error("Error in WebSocket: ${e.message}")
|
||||
removeSession(uid, this)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -87,6 +87,7 @@ fun Routing.wsTimerRoutes() {
|
||||
}
|
||||
} catch(e: ClosedReceiveChannelException) {
|
||||
logger.error("Error in WebSocket: ${e.message}")
|
||||
removeSession(uid, this)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user