mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-10 18:40:15 +08:00
Add CoroutineName for input thread
This commit is contained in:
parent
42a4c844e1
commit
335299275b
@ -10,6 +10,7 @@
|
|||||||
package net.mamoe.mirai.console.pure
|
package net.mamoe.mirai.console.pure
|
||||||
|
|
||||||
import kotlinx.coroutines.CancellationException
|
import kotlinx.coroutines.CancellationException
|
||||||
|
import kotlinx.coroutines.CoroutineName
|
||||||
import kotlinx.coroutines.cancel
|
import kotlinx.coroutines.cancel
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import net.mamoe.mirai.console.MiraiConsole
|
import net.mamoe.mirai.console.MiraiConsole
|
||||||
@ -28,7 +29,7 @@ val consoleLogger by lazy { DefaultLogger("console") }
|
|||||||
|
|
||||||
@OptIn(ConsoleInternalAPI::class)
|
@OptIn(ConsoleInternalAPI::class)
|
||||||
internal fun startupConsoleThread() {
|
internal fun startupConsoleThread() {
|
||||||
MiraiConsole.launch {
|
MiraiConsole.launch(CoroutineName("Input")) {
|
||||||
while (true) {
|
while (true) {
|
||||||
try {
|
try {
|
||||||
val next = MiraiConsole.requestInput("").let {
|
val next = MiraiConsole.requestInput("").let {
|
||||||
|
Loading…
Reference in New Issue
Block a user