Closed MorganEPatch closed 6 years ago
Ok, then please use this function instead: https://golang.org/pkg/time/#Time.Truncate
On Mon, Aug 21, 2017 at 4:26 PM, Morgan Patch notifications@github.com wrote:
@LyonesGamer commented on this pull request.
In lib/clients/github.go https://github.com/coreos/issue-sync/pull/25#discussion_r134353993:
@@ -167,7 +171,12 @@ func (g realGHClient) request(f func() (interface{}, *github.Response, error)) ( b := backoff.NewExponentialBackOff() b.MaxElapsedTime = g.config.GetTimeout()
- er := backoff.Retry(op, b)
- er := backoff.RetryNotify(op, b, func(err error, duration time.Duration) {
- duration /= 1000000 // Convert nanoseconds to milliseconds
- duration *= 1000000 // Convert back so it appears correct
Right, but the numbers are randomized. I was instead getting things like 1s374.926427ms, so I wanted to truncate it to millisecond-level precision to make it more readable.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/coreos/issue-sync/pull/25#discussion_r134353993, or mute the thread https://github.com/notifications/unsubscribe-auth/ATiQPyCte0qGt2LDR953kxgIG_OCJQjtks5sahJBgaJpZM4O96X- .
@squat That's a function on time.Time, not time.Duration. How would you recommend doing that conversion?
Ah yes very true. OK, well for lack of a time.Round for durations. Please truncate using the const time.Millisecond instead of 1000000. sound good?
If an API request error occurs, print out the error and the next backoff time.
@squat