mirror of
https://github.com/dalbodeule/chibot-chzzk-bot.git
synced 2025-08-07 21:01:14 +00:00
[feature] add some api, etc..
- add some api - add /metrics routing
This commit is contained in:
@@ -9,6 +9,7 @@ import space.mori.chzzk_bot.chatbot.chzzk.Connector.getChannel
|
||||
import space.mori.chzzk_bot.chatbot.discord.Discord
|
||||
import space.mori.chzzk_bot.chatbot.utils.refreshAccessToken
|
||||
import space.mori.chzzk_bot.common.events.*
|
||||
import space.mori.chzzk_bot.common.metrics.Metrics
|
||||
import space.mori.chzzk_bot.common.models.User
|
||||
import space.mori.chzzk_bot.common.services.LiveStatusService
|
||||
import space.mori.chzzk_bot.common.services.TimerConfigService
|
||||
@@ -293,6 +294,7 @@ class UserHandler(
|
||||
|
||||
logger.info("ChzzkChat connecting... ${channel.channelName} - ${channel.channelId}")
|
||||
streamStartTime = LocalDateTime.now()
|
||||
Metrics.streaming++
|
||||
|
||||
if(!_isActive) {
|
||||
_isActive = true
|
||||
@@ -329,6 +331,7 @@ class UserHandler(
|
||||
listener?.unsubscribeAsync(ChzzkSessionSubscriptionType.CHAT)?.join()
|
||||
listener?.disconnectAsync()?.join()
|
||||
_isActive = false
|
||||
Metrics.streaming--;
|
||||
|
||||
CoroutineScope(Dispatchers.Default).launch {
|
||||
val events = listOf(
|
||||
|
Reference in New Issue
Block a user