| 377 | } |
| 378 | |
| 379 | func naptime(totalWait fs.Duration) { |
| 380 | expireTime := time.Now().Add(time.Duration(totalWait)) |
| 381 | fs.Logf(nil, "will retry in %v at %v", totalWait, expireTime.Format("2006-01-02 15:04:05 MST")) |
| 382 | for i := 0; time.Until(expireTime) > 0; i++ { |
| 383 | if i > 0 && i%10 == 0 { |
| 384 | fs.Infof(nil, Color(terminal.Dim, "retrying in %v..."), time.Until(expireTime).Round(1*time.Second)) |
| 385 | } else { |
| 386 | fs.Debugf(nil, Color(terminal.Dim, "retrying in %v..."), time.Until(expireTime).Round(1*time.Second)) |
| 387 | } |
| 388 | time.Sleep(1 * time.Second) |
| 389 | } |
| 390 | } |