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

refactor: fix code lint warnings

This commit is contained in:
Timothy
2020-08-10 14:39:56 +08:00
parent e94d99e25c
commit 1ddd1dfb8b
6 changed files with 24 additions and 18 deletions

View File

@@ -49,18 +49,18 @@ func main() {
func dnsLoop() {
panicChan := make(chan godns.Domain)
log.Println("Creating DNS handler with provider:", configuration.Provider)
handler := handler.CreateHandler(configuration.Provider)
handler.SetConfiguration(&configuration)
log.Println("Creating DNS h with provider:", configuration.Provider)
h := handler.CreateHandler(configuration.Provider)
h.SetConfiguration(&configuration)
for i := range configuration.Domains {
go handler.DomainLoop(&configuration.Domains[i], panicChan)
go h.DomainLoop(&configuration.Domains[i], panicChan)
}
panicCount := 0
for {
failDomain := <-panicChan
log.Println("Got panic in goroutine, will start a new one... :", panicCount)
go handler.DomainLoop(&failDomain, panicChan)
go h.DomainLoop(&failDomain, panicChan)
panicCount++
if panicCount >= godns.PanicMax {