mirror of
https://github.com/dalbodeule/chibot-chzzk-bot.git
synced 2025-06-09 15:28:21 +00:00
debug WSSongListRoutes.kt
- session deleted.
This commit is contained in:
parent
18d28262d1
commit
9a91537e59
@ -105,7 +105,7 @@ fun Routing.wsSongListRoutes() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch(e: Exception) {
|
} catch(e: Exception) {
|
||||||
logger.debug("SongType.ADD Error: {} / {}", uid, e)
|
logger.debug("SongType.ADD Error: $uid $e")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(data.type == SongType.REMOVE.value && data.url != null) {
|
else if(data.type == SongType.REMOVE.value && data.url != null) {
|
||||||
@ -152,8 +152,7 @@ fun Routing.wsSongListRoutes() {
|
|||||||
CoroutineScope(Dispatchers.Default).launch {
|
CoroutineScope(Dispatchers.Default).launch {
|
||||||
val user = UserService.getUser(it.uid)
|
val user = UserService.getUser(it.uid)
|
||||||
if(user != null) {
|
if(user != null) {
|
||||||
val session = SongConfigService.getConfig(user)
|
sessions[user.token ?: ""]?.forEach { ws ->
|
||||||
sessions[session.token ?: ""]?.forEach { ws ->
|
|
||||||
ws.sendSerialized(
|
ws.sendSerialized(
|
||||||
SongResponse(
|
SongResponse(
|
||||||
it.type.value,
|
it.type.value,
|
||||||
@ -176,7 +175,7 @@ fun Routing.wsSongListRoutes() {
|
|||||||
if(user != null) {
|
if(user != null) {
|
||||||
val session = SongConfigService.getConfig(user)
|
val session = SongConfigService.getConfig(user)
|
||||||
|
|
||||||
sessions[session.token ?: ""]?.forEach { ws ->
|
sessions[user.token]?.forEach { ws ->
|
||||||
ws.sendSerialized(
|
ws.sendSerialized(
|
||||||
SongResponse(
|
SongResponse(
|
||||||
it.type.value,
|
it.type.value,
|
||||||
@ -188,7 +187,7 @@ fun Routing.wsSongListRoutes() {
|
|||||||
null
|
null
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
removeSession(session.token ?: "", ws)
|
removeSession(user.token ?: "", ws)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user