fix possible resource leak
This commit is contained in:
parent
fe55304184
commit
62dfdc1adb
1 changed files with 3 additions and 1 deletions
|
@ -236,8 +236,10 @@ func (v *YoutubeVideo) download(useIPv6 bool) error {
|
||||||
|
|
||||||
time.Sleep(ip_manager.IPCooldownPeriod)
|
time.Sleep(ip_manager.IPCooldownPeriod)
|
||||||
sourceAddress, err = v.pool.GetIP()
|
sourceAddress, err = v.pool.GetIP()
|
||||||
if err == nil { //TODO: This is possibly not 100% right, but it works so I'm not touching it...
|
if err == nil {
|
||||||
break
|
break
|
||||||
|
} else if !errors.Is(err, ip_manager.ErrAllThrottled) {
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue