actually use the functions I create...
This commit is contained in:
parent
43f745ae20
commit
1331e5769f
2 changed files with 3 additions and 1 deletions
|
@ -66,12 +66,13 @@ func GetNextIP(ipv6 bool) (string, error) {
|
||||||
return nextIP, nil
|
return nextIP, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func releaseIP(ip string) {
|
func ReleaseIP(ip string) {
|
||||||
ipMutex.Lock()
|
ipMutex.Lock()
|
||||||
defer ipMutex.Unlock()
|
defer ipMutex.Unlock()
|
||||||
ipLastUsed[ip] = time.Now()
|
ipLastUsed[ip] = time.Now()
|
||||||
ipInUse[ip] = false
|
ipInUse[ip] = false
|
||||||
}
|
}
|
||||||
|
|
||||||
func getLeastUsedIP(ipPool []string) string {
|
func getLeastUsedIP(ipPool []string) string {
|
||||||
nextIP := ""
|
nextIP := ""
|
||||||
veryLastUse := time.Now()
|
veryLastUse := time.Now()
|
||||||
|
|
|
@ -221,6 +221,7 @@ func (v *YoutubeVideo) download(useIPv6 bool) error {
|
||||||
return errors.Err(err)
|
return errors.Err(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
defer ipManager.ReleaseIP(sourceAddress)
|
||||||
if useIPv6 {
|
if useIPv6 {
|
||||||
log.Infof("using IPv6: %s", sourceAddress)
|
log.Infof("using IPv6: %s", sourceAddress)
|
||||||
ytdlArgs = append(ytdlArgs,
|
ytdlArgs = append(ytdlArgs,
|
||||||
|
|
Loading…
Reference in a new issue