mirror of
https://github.com/tgdrive/teldrive.git
synced 2024-09-20 08:15:55 +08:00
chore: add all bots in stream
This commit is contained in:
parent
c7be0ead76
commit
a64eb57ea4
|
@ -28,6 +28,9 @@ func NewBotWorker() *BotWorker {
|
|||
func (w *BotWorker) Set(bots []string, channelID int64) {
|
||||
w.mu.Lock()
|
||||
defer w.mu.Unlock()
|
||||
if _, ok := w.bots[channelID]; ok {
|
||||
return
|
||||
}
|
||||
w.bots[channelID] = bots
|
||||
w.currIdx[channelID] = 0
|
||||
}
|
||||
|
|
|
@ -750,7 +750,7 @@ func (fs *FileService) GetFileStream(c *gin.Context, download bool) {
|
|||
multiThreads = 0
|
||||
|
||||
} else if fs.cnf.TG.DisableBgBots && len(tokens) > 0 {
|
||||
fs.botWorker.Set(tokens[0:min(len(tokens), fs.cnf.TG.Stream.BotsLimit)], file.ChannelID)
|
||||
fs.botWorker.Set(tokens, file.ChannelID)
|
||||
token, _ = fs.botWorker.Next(file.ChannelID)
|
||||
client, err = tgc.BotClient(c, fs.kv, &fs.cnf.TG, token)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in a new issue