mirror of
https://github.com/dalbodeule/chibot-chzzk-bot.git
synced 2026-11-05 22:29:31 +09:00
[feature] add some api, etc..
- add some api - add /metrics routing
This commit is contained in:
8 files changed
+143
-4
No files matched your search
@@ -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