Refactor: move Start operation out of LoadProxyTXT
This commit is contained in:
parent
7faea867f5
commit
c3d92d723a
@ -19,12 +19,6 @@ func (s *Swamp) LoadProxyTXT(seedFile string) error {
|
||||
|
||||
scan := bufio.NewScanner(f)
|
||||
|
||||
if !s.started {
|
||||
go s.tossUp()
|
||||
go s.feed()
|
||||
s.started = true
|
||||
}
|
||||
|
||||
for scan.Scan() {
|
||||
s.mu.Lock()
|
||||
s.scvm = append(s.scvm, scan.Text())
|
||||
|
9
main.go
9
main.go
@ -6,6 +6,15 @@ const (
|
||||
rst = "\033[0m"
|
||||
)
|
||||
|
||||
// Start starts our proxy pool operations. Trying to start a running Swamp is a nonop.
|
||||
func (s *Swamp) Start() {
|
||||
if !s.started {
|
||||
go s.tossUp()
|
||||
go s.feed()
|
||||
s.started = true
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Pause will cease the creation of any new proxy validation operations.
|
||||
* You will be able to start the proxy pool again with Swamp.Resume(), it will have the same Statistics, options, and ratelimits.
|
||||
|
Loading…
Reference in New Issue
Block a user