Skip to content

Commit

Permalink
简单优化/修复变量引用
Browse files Browse the repository at this point in the history
  • Loading branch information
ForteScarlet committed Jun 23, 2024
1 parent f75de77 commit 7232394
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -321,14 +321,14 @@ internal class OneBotBotImpl(

while (session == null && retryTimes <= connectMaxRetryTimes) {
try {
logger.debug("Connect to ws server {}", eventServerHost)
logger.debug("Connect to ws server {}", wsHost)
session = createSession()
} catch (e: Exception) {
retryTimes++

@Suppress("ConvertTwoComparisonsToRangeCheck")
if (connectMaxRetryTimes > 0 && retryTimes > connectMaxRetryTimes) {
"Connect to ws server $eventServerHost failed in $retryTimes times.".also { msg ->
"Connect to ws server $wsHost failed in $retryTimes times.".also { msg ->
val ex = IllegalStateException(msg)
sessionJob.completeExceptionally(ex)

Expand All @@ -339,7 +339,7 @@ internal class OneBotBotImpl(
if (logger.isWarnEnabled()) {
logger.warn(
"Connect to ws server {} failed: {}, retry in {}...",
eventServerHost,
wsHost,
e.message,
connectRetryDelay.toString(),
e,
Expand Down Expand Up @@ -386,7 +386,7 @@ internal class OneBotBotImpl(

if (currentSession == null) return

logger.debug("Connected to ws server {}, session: {}", eventServerHost, currentSession)
logger.debug("Connected to ws server {}, session: {}", wsHost, currentSession)

this@WsEventSession.session = currentSession

Expand Down

0 comments on commit 7232394

Please sign in to comment.