diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-02-16 19:37:10 +0300 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-02-16 19:37:10 +0300 |
commit | 9747e5820ce129895e95355b254d110cb39496a4 (patch) | |
tree | 15de284bad0b0344738dcfe7fe57596825e2b661 /domains.go | |
parent | a9b41da7fc5a07eae0a72dc7e59f323a73e74a54 (diff) |
Fix small bugs
Diffstat (limited to 'domains.go')
-rw-r--r-- | domains.go | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -125,12 +125,15 @@ func watchDomains(rootDomain string, updater domainsUpdater, interval time.Durat lastUpdate := []byte("no-update") for { + // Read the update file update, err := ioutil.ReadFile(".update") + if err != nil && !os.IsNotExist(err) { + log.Println("Failed to read update timestamp:", err) + } + + // If it's the same ignore if bytes.Equal(lastUpdate, update) { - if err != nil { - log.Println("Failed to read update timestamp:", err) - time.Sleep(interval) - } + time.Sleep(interval) continue } lastUpdate = update |