Commit 1331e576 authored by ci's avatar ci
Browse files

actually use the functions I create...

parent 43f745ae
......@@ -66,12 +66,13 @@ func GetNextIP(ipv6 bool) (string, error) {
return nextIP, nil
}
func releaseIP(ip string) {
func ReleaseIP(ip string) {
ipMutex.Lock()
defer ipMutex.Unlock()
ipLastUsed[ip] = time.Now()
ipInUse[ip] = false
}
func getLeastUsedIP(ipPool []string) string {
nextIP := ""
veryLastUse := time.Now()
......
......@@ -221,6 +221,7 @@ func (v *YoutubeVideo) download(useIPv6 bool) error {
return errors.Err(err)
}
}
defer ipManager.ReleaseIP(sourceAddress)
if useIPv6 {
log.Infof("using IPv6: %s", sourceAddress)
ytdlArgs = append(ytdlArgs,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment