You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Account for fast mono clock when polling in device flow (#111)
* fix(poller): introduce wait interval multiplier
Signed-off-by: Babak K. Shandiz <babakks@github.com>
* refactor: collapse repeated post args
Signed-off-by: Babak K. Shandiz <babakks@github.com>
* fix: tune clock drift for slow-mono case
Signed-off-by: Babak K. Shandiz <babakks@github.com>
* fix: bail out on the 3rd slow_down
Signed-off-by: Babak K. Shandiz <babakks@github.com>
* docs: fix comment
Signed-off-by: Babak K. Shandiz <babakks@github.com>
* fix: bail out on the 2nd slow_down
Signed-off-by: Babak K. Shandiz <babakks@github.com>
---------
Signed-off-by: Babak K. Shandiz <babakks@github.com>
returnnil, fmt.Errorf("too many slow_down responses; detected clock drift of roughly %.0f%% between monotonic and wall clocks; please ensure your system clock is accurate", driftRatio*100)
257
+
}
258
+
202
259
// Based on the RFC spec, we must add 5 seconds to our current polling interval.
203
260
// (See https://www.rfc-editor.org/rfc/rfc8628#section-3.5)
204
261
newInterval:=poll.GetInterval() +5*time.Second
@@ -213,9 +270,17 @@ func Wait(ctx context.Context, c httpClient, uri string, opts WaitOptions) (*api
0 commit comments