Decrease log noise by logging retry loops after the initial attempt

pull/3477/head
Thomas Stromberg 2018-12-20 10:27:47 -08:00
parent 15dfcd1aa1
commit fcaf89666f
1 changed files with 3 additions and 1 deletions

View File

@ -97,7 +97,9 @@ func Retry(attempts int, callback func() error) (err error) {
func RetryAfter(attempts int, callback func() error, d time.Duration) (err error) {
m := MultiError{}
for i := 0; i < attempts; i++ {
glog.V(1).Infof("retry loop %d", i)
if i > 0 {
glog.V(1).Infof("retry loop %d", i)
}
err = callback()
if err == nil {
return nil