From 3e0246771eec2709b78e2442d293b55815b7776e Mon Sep 17 00:00:00 2001 From: dalbodeule <11470513+dalbodeule@users.noreply.github.com> Date: Sat, 14 Sep 2024 18:36:24 +0900 Subject: [PATCH] debug on ApiCommandRoutes.kt, SongList.kt - ApiCommandRoutes.kt is CommandReloadEvent post 4 times. - SongList.kt is song_list.req_name length 20 to 80(byte) --- .../space/mori/chzzk_bot/common/models/SongList.kt | 2 +- .../chzzk_bot/webserver/routes/ApiCommandRoutes.kt | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/common/src/main/kotlin/space/mori/chzzk_bot/common/models/SongList.kt b/common/src/main/kotlin/space/mori/chzzk_bot/common/models/SongList.kt index 2330baa..9d2cdbb 100644 --- a/common/src/main/kotlin/space/mori/chzzk_bot/common/models/SongList.kt +++ b/common/src/main/kotlin/space/mori/chzzk_bot/common/models/SongList.kt @@ -12,7 +12,7 @@ object SongLists: IntIdTable("song_list") { val uid = varchar("uid", 64) val url = varchar("url", 128) val name = text("name") - val reqName = varchar("req_name", 20) + val reqName = varchar("req_name", 80) val author = text("author") val time = integer("time") val created_at = datetime("created_at").default(LocalDateTime.now()) diff --git a/webserver/src/main/kotlin/space/mori/chzzk_bot/webserver/routes/ApiCommandRoutes.kt b/webserver/src/main/kotlin/space/mori/chzzk_bot/webserver/routes/ApiCommandRoutes.kt index 8629a5f..b7a1456 100644 --- a/webserver/src/main/kotlin/space/mori/chzzk_bot/webserver/routes/ApiCommandRoutes.kt +++ b/webserver/src/main/kotlin/space/mori/chzzk_bot/webserver/routes/ApiCommandRoutes.kt @@ -69,7 +69,9 @@ fun Routing.apiCommandRoutes() { commandRequest.failContent ?: "" ) CoroutineScope(Dispatchers.Default).launch { - dispatcher.post(CommandReloadEvent(user.token ?: "")) + for(i: Int in 0..3) { + dispatcher.post(CommandReloadEvent(user.token ?: "")) + } } call.respond(HttpStatusCode.OK) } @@ -104,7 +106,9 @@ fun Routing.apiCommandRoutes() { commandRequest.failContent ?: "" ) CoroutineScope(Dispatchers.Default).launch { - dispatcher.post(CommandReloadEvent(user.token ?: "")) + for(i: Int in 0..3) { + dispatcher.post(CommandReloadEvent(user.token ?: "")) + } } call.respond(HttpStatusCode.OK) } catch(e: Exception) { @@ -137,7 +141,9 @@ fun Routing.apiCommandRoutes() { try { CommandService.removeCommand(user, commandRequest.label) CoroutineScope(Dispatchers.Default).launch { - dispatcher.post(CommandReloadEvent(user.token ?: "")) + for(i: Int in 0..3) { + dispatcher.post(CommandReloadEvent(user.token ?: "")) + } } call.respond(HttpStatusCode.OK) } catch(e: Exception) {