Fix recycling
This commit is contained in:
parent
66223abe8e
commit
ece90669f9
|
@ -124,8 +124,15 @@ func (p5 *ProxyEngine) jobSpawner() {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var sock *Proxy
|
||||||
|
|
||||||
p5.Pending.Lock()
|
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.Pending.Unlock()
|
||||||
|
|
||||||
_ = p5.scale()
|
_ = p5.scale()
|
||||||
|
|
2
defs.go
2
defs.go
|
@ -68,7 +68,7 @@ type ProxyEngine struct {
|
||||||
stats *Statistics
|
stats *Statistics
|
||||||
|
|
||||||
Status uint32
|
Status uint32
|
||||||
|
|
||||||
// Pending is a constant stream of proxy strings to be verified
|
// Pending is a constant stream of proxy strings to be verified
|
||||||
Pending proxyList
|
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
|
hc.Timeout = timeout
|
||||||
}
|
}
|
||||||
|
return hc
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetHTTPClient retrieves a pointer to an http.Client powered by mysteryDialer.
|
// GetHTTPClient retrieves a pointer to an http.Client powered by mysteryDialer.
|
||||||
|
|
Loading…
Reference in New Issue