Skip to content

Commit

Permalink
beta463
Browse files Browse the repository at this point in the history
  • Loading branch information
Hoshinonyaruko committed Jul 15, 2024
1 parent 58304eb commit 7e7c9f3
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions botgo/sessions/local/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ func (l *ChanManager) StartSingle(apInfo *dto.WebsocketAPSingle, token *token.To
apInfo.ShardCount, startInterval)

// 只启动一个分片

// 按照1数量初始化,用于启动连接的管理
l.sessionChan = make(chan dto.Session, 1)
session := dto.Session{
URL: apInfo.URL,
Token: *token,
Expand All @@ -80,9 +81,13 @@ func (l *ChanManager) StartSingle(apInfo *dto.WebsocketAPSingle, token *token.To
ShardCount: apInfo.ShardCount,
},
}
l.sessionChan <- session

time.Sleep(startInterval)
go l.newConnect(session)
for session := range l.sessionChan {
// MaxConcurrency 代表的是每 5s 可以连多少个请求
time.Sleep(startInterval)
go l.newConnect(session)
}

return nil
}
Expand Down

0 comments on commit 7e7c9f3

Please sign in to comment.