Add CoroutineName for input thread

This commit is contained in:
Him188 2020-09-10 09:04:31 +08:00
parent 42a4c844e1
commit 335299275b

View File

@ -10,6 +10,7 @@
package net.mamoe.mirai.console.pure
import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.CoroutineName
import kotlinx.coroutines.cancel
import kotlinx.coroutines.launch
import net.mamoe.mirai.console.MiraiConsole
@ -28,7 +29,7 @@ val consoleLogger by lazy { DefaultLogger("console") }
@OptIn(ConsoleInternalAPI::class)
internal fun startupConsoleThread() {
MiraiConsole.launch {
MiraiConsole.launch(CoroutineName("Input")) {
while (true) {
try {
val next = MiraiConsole.requestInput("").let {