1
0
mirror of https://github.com/taigrr/godns synced 2025-01-18 04:03:25 -08:00

bug fix for sleeping

This commit is contained in:
Timothy 2017-10-30 14:33:30 +08:00
parent 4b69c69f34
commit 9020971add
2 changed files with 19 additions and 20 deletions

View File

@ -57,10 +57,8 @@ func (handler *DNSPodHandler) DomainLoop(domain *godns.Domain, panicChan chan<-
if savedIP != "" && strings.TrimRight(currentIP, "\n") == strings.TrimRight(savedIP, "\n") {
log.Printf("Current IP is not changed, no need to update...")
continue
} else {
godns.SaveCurrentIP(currentIP)
}
for _, subDomain := range domain.SubDomains {
@ -79,8 +77,10 @@ func (handler *DNSPodHandler) DomainLoop(domain *godns.Domain, panicChan chan<-
log.Printf("%s.%s Current IP is same as domain IP, no need to update...\n", subDomain, domain.DomainName)
}
}
}
//Interval is 5 minutes
log.Printf("Going to sleep, will start next checking in %d minutes...\r\n", godns.INTERVAL)
time.Sleep(time.Minute * godns.INTERVAL)
}
}

View File

@ -53,17 +53,16 @@ func (handler *HEHandler) DomainLoop(domain *godns.Domain, panicChan chan<- godn
if savedIP != "" && currentIP == savedIP {
log.Printf("Current IP is not changed, no need to update...")
continue
} else {
godns.SaveCurrentIP(currentIP)
}
for _, subDomain := range domain.SubDomains {
log.Printf("%s.%s Start to update record IP...\n", subDomain, domain.DomainName)
handler.UpdateIP(domain.DomainName, subDomain, currentIP)
}
}
// Interval is 5 minutes
log.Printf("Going to sleep, will start next checking in %d minutes...\r\n", godns.INTERVAL)
time.Sleep(time.Minute * godns.INTERVAL)
}
}