mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-26 16:10:11 +08:00
Replace usages of unstable API
This commit is contained in:
parent
b25ea78c6f
commit
94f54b7c6d
@ -16,7 +16,6 @@ import net.mamoe.mirai.console.internal.util.runIgnoreException
|
|||||||
import net.mamoe.mirai.utils.currentTimeMillis
|
import net.mamoe.mirai.utils.currentTimeMillis
|
||||||
import kotlin.coroutines.CoroutineContext
|
import kotlin.coroutines.CoroutineContext
|
||||||
import kotlin.coroutines.EmptyCoroutineContext
|
import kotlin.coroutines.EmptyCoroutineContext
|
||||||
import kotlin.time.seconds
|
|
||||||
|
|
||||||
@ConsoleExperimentalApi
|
@ConsoleExperimentalApi
|
||||||
public object CoroutineScopeUtils {
|
public object CoroutineScopeUtils {
|
||||||
@ -70,7 +69,7 @@ internal class TimedTask(
|
|||||||
val current = currentTimeMillis()
|
val current = currentTimeMillis()
|
||||||
if (last == UNCHANGED) {
|
if (last == UNCHANGED) {
|
||||||
runIgnoreException<CancellationException> {
|
runIgnoreException<CancellationException> {
|
||||||
delay(3.seconds) // accuracy not necessary
|
delay(3000) // accuracy not necessary
|
||||||
} ?: return@launch
|
} ?: return@launch
|
||||||
} else {
|
} else {
|
||||||
if (current - last > intervalMillis) {
|
if (current - last > intervalMillis) {
|
||||||
@ -78,7 +77,7 @@ internal class TimedTask(
|
|||||||
action()
|
action()
|
||||||
}
|
}
|
||||||
runIgnoreException<CancellationException> {
|
runIgnoreException<CancellationException> {
|
||||||
delay(3.seconds) // accuracy not necessary
|
delay(3000) // accuracy not necessary
|
||||||
} ?: return@launch
|
} ?: return@launch
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 Mamoe Technologies and contributors.
|
* Copyright 2019-2021 Mamoe Technologies and contributors.
|
||||||
*
|
*
|
||||||
* 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
|
* 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
|
||||||
* Use of this source code is governed by the GNU AFFERO GENERAL PUBLIC LICENSE version 3 license that can be found through the following link.
|
* Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
|
||||||
*
|
*
|
||||||
* https://github.com/mamoe/mirai/blob/master/LICENSE
|
* https://github.com/mamoe/mirai/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@file:Suppress(
|
@file:Suppress(
|
||||||
@ -36,7 +36,6 @@ import java.io.FileDescriptor
|
|||||||
import java.io.FileOutputStream
|
import java.io.FileOutputStream
|
||||||
import java.io.PrintStream
|
import java.io.PrintStream
|
||||||
import kotlin.system.exitProcess
|
import kotlin.system.exitProcess
|
||||||
import kotlin.time.minutes
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* mirai-console-terminal CLI 入口点
|
* mirai-console-terminal CLI 入口点
|
||||||
@ -159,7 +158,7 @@ object MiraiConsoleTerminalLoader {
|
|||||||
internal object ConsoleDataHolder : AutoSavePluginDataHolder,
|
internal object ConsoleDataHolder : AutoSavePluginDataHolder,
|
||||||
CoroutineScope by MiraiConsole.childScope("ConsoleDataHolder") {
|
CoroutineScope by MiraiConsole.childScope("ConsoleDataHolder") {
|
||||||
@ConsoleExperimentalApi
|
@ConsoleExperimentalApi
|
||||||
override val autoSaveIntervalMillis: LongRange = 1.minutes.toLongMilliseconds()..10.minutes.toLongMilliseconds()
|
override val autoSaveIntervalMillis: LongRange = 60_000L..10.times(60_000)
|
||||||
|
|
||||||
@ConsoleExperimentalApi
|
@ConsoleExperimentalApi
|
||||||
override val dataHolderName: String
|
override val dataHolderName: String
|
||||||
|
Loading…
Reference in New Issue
Block a user