Skip to content

Commit

Permalink
feat: Updated core/method/methods/motd.go
Browse files Browse the repository at this point in the history
  • Loading branch information
sweep-ai[bot] committed Dec 9, 2023
1 parent a496912 commit ad74e1d
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions core/method/methods/motd.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,32 @@ func (motd MOTD) Description() string {
}

func (motd MOTD) Start() {
// Create a worker pool
workerPool := make(chan struct{}, 10) // 10 is the number of workers
stop := make(chan struct{})

// Start the workers
for i := 0; i < 10; i++ {
go func() {
for {
select {
case <-stop:
return
case workerPool <- struct{}{}:
// Get the next proxy
proxy := motd.ProxyManager.GetNext()
// Do the work
// ...
// When done, release the worker
<-workerPool
}
}
}()
}
}

func (motd MOTD) Stop() {
// implementation for stopping the Motd method
}
close(stop)
}

0 comments on commit ad74e1d

Please sign in to comment.