fix possible resource leak

This commit is contained in:
Niko Storni 2019-12-14 05:49:25 +01:00
parent fe55304184
commit 62dfdc1adb

View file

@ -236,8 +236,10 @@ func (v *YoutubeVideo) download(useIPv6 bool) error {
time.Sleep(ip_manager.IPCooldownPeriod)
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
} else if !errors.Is(err, ip_manager.ErrAllThrottled) {
return err
}
}
} else {