Skip to content

Commit

Permalink
Beta463 (#465)
Browse files Browse the repository at this point in the history
* beta447

* beta448

* beta449

* beta450

* beta451

* beta452

* beta453

* beta454

* beta455

* btea455

* beta456

* beta457

* beta458

* beta460

* beta460

* beta461

* beta462

* beta463
  • Loading branch information
Hoshinonyaruko authored Jul 15, 2024
1 parent 04d046d commit 3ccddd8
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 3ccddd8

Please sign in to comment.