Fix recycling
This commit is contained in:
parent
66223abe8e
commit
ece90669f9
|
@ -124,8 +124,15 @@ func (p5 *ProxyEngine) jobSpawner() {
|
|||
continue
|
||||
}
|
||||
|
||||
var sock *Proxy
|
||||
|
||||
p5.Pending.Lock()
|
||||
sock := p5.Pending.Remove(p5.Pending.Front()).(*Proxy)
|
||||
switch p5.GetRecyclingStatus() {
|
||||
case true:
|
||||
el := p5.Pending.Front()
|
||||
p5.Pending.MoveToBack(el)
|
||||
sock = el.Value.(*Proxy)
|
||||
}
|
||||
p5.Pending.Unlock()
|
||||
|
||||
_ = p5.scale()
|
||||
|
|
2
defs.go
2
defs.go
|
@ -68,7 +68,7 @@ type ProxyEngine struct {
|
|||
stats *Statistics
|
||||
|
||||
Status uint32
|
||||
|
||||
|
||||
// Pending is a constant stream of proxy strings to be verified
|
||||
Pending proxyList
|
||||
|
||||
|
|
|
@ -32,9 +32,10 @@ func (p5 *ProxyEngine) newHTTPClient() any {
|
|||
},
|
||||
}
|
||||
|
||||
if timeout != time.Unix(0, 0) {
|
||||
if timeout != time.Duration(0) {
|
||||
hc.Timeout = timeout
|
||||
}
|
||||
return hc
|
||||
}
|
||||
|
||||
// GetHTTPClient retrieves a pointer to an http.Client powered by mysteryDialer.
|
||||
|
|
Loading…
Reference in New Issue