diff --git a/reflector/stats.go b/reflector/stats.go index 5501bbe..c0f9b57 100644 --- a/reflector/stats.go +++ b/reflector/stats.go @@ -102,8 +102,10 @@ func (s *stats) log() { delete(s.errors, name) } s.mu.Unlock() - s.logger.Printf( - "Stats: %d blobs, %d streams, errors: %s", - blobs, streams, errStr[:len(errStr)-2], // trim last comma and space - ) + + if len(errStr) > 2 { + errStr = errStr[:len(errStr)-2] // trim last comma and space + } + + s.logger.Printf("Stats: %d blobs, %d streams, errors: %s", blobs, streams, errStr) } diff --git a/updater/updater.go b/updater/updater.go index dc8cd96..dc875e1 100644 --- a/updater/updater.go +++ b/updater/updater.go @@ -15,8 +15,9 @@ import ( // TODO: this needs to be shut down cleanly func Run(url, updateCmd string) { + t := time.NewTicker(1 * time.Minute) for { - <-time.After(1 * time.Minute) + <-t.C r, err := http.Head(url) if err != nil {