MCPcopy
hub / github.com/EverythingSuckz/TG-FileStreamBot / GetNextWorker

Function GetNextWorker

internal/bot/workers.go:85–93  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

83}
84
85func GetNextWorker() *Worker {
86 Workers.mut.Lock()
87 defer Workers.mut.Unlock()
88 index := (Workers.index + 1) % len(Workers.Bots)
89 Workers.index = index
90 worker := Workers.Bots[index]
91 Workers.log.Sugar().Debugf("Using worker %d", worker.ID)
92 return worker
93}
94
95func StartWorkers(log *zap.Logger) (*BotWorkers, error) {
96 Workers.Init(log)

Callers 1

getStreamRouteFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected