debug some errors.

- ChzzkHandler.runStreamInfo debugs with startThread functions.
This commit is contained in:
dalbodeule 2024-08-13 19:20:16 +09:00
parent f994972fac
commit 910886f8b5
No known key found for this signature in database
GPG Key ID: EFA860D069C9FA65

View File

@ -3,6 +3,7 @@ package space.mori.chzzk_bot.chatbot.chzzk
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay
import kotlinx.coroutines.future.await
import kotlinx.coroutines.launch
import org.koin.java.KoinJavaComponent.inject
import org.slf4j.Logger
@ -215,15 +216,15 @@ class UserHandler(
internal fun isActive(value: Boolean, status: IData<IStreamInfo?>) {
if(value) {
CoroutineScope(Dispatchers.Default).launch {
if(!_isActive) {
logger.info("${user.username} is live.")
logger.info("ChzzkChat connecting... ${channel.channelName} - ${channel.channelId}")
listener.connectBlocking()
listener.connectAsync().await()
streamStartTime = status.content?.openDate?.let { convertChzzkDateToLocalDateTime(it) }
CoroutineScope(Dispatchers.Default).launch {
if(!_isActive) {
_isActive = true
when(TimerConfigService.getConfig(UserService.getUser(channel.channelId)!!)?.option) {
TimerType.UPTIME.value -> dispatcher.post(