From 81b3e054f23290c83a45eaaafe94d7c562a47fbb Mon Sep 17 00:00:00 2001 From: Jay Date: Tue, 23 Jan 2018 09:35:49 +0800 Subject: [PATCH] fin v1 --- main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 7b78a9f..f3449ac 100644 --- a/main.go +++ b/main.go @@ -82,11 +82,12 @@ func main() { go func() { for { + println("run loop") for _, it := range domains { it.updateRecord() } - time.Sleep(time.Duration.Minutes * 5) + time.Sleep(time.Minute * 5) } }() @@ -131,6 +132,7 @@ func getMyIP() string { func (it *Domains) updateRecord() { if len(it.Sub) == 0 { + println("no subdomain") return } listInput := &route53.ListResourceRecordSetsInput{ @@ -159,6 +161,7 @@ func (it *Domains) updateRecord() { } if len(chs) == 0 { + println("ip not change or not type a record") return } @@ -170,6 +173,7 @@ func (it *Domains) updateRecord() { } _, err = r53.ChangeResourceRecordSets(changeInput) checkErr(err) + println("update ok") } func getZones(names []string) (zones []*route53.HostedZone, err error) {