MCPcopy Index your code
hub / github.com/google/go-github / sleepUntilResetWithBuffer

Function sleepUntilResetWithBuffer

github/github.go:2026–2038  ·  view source on GitHub ↗
(ctx context.Context, reset time.Time)

Source from the content-addressed store, hash-verified

2024}
2025
2026func sleepUntilResetWithBuffer(ctx context.Context, reset time.Time) error {
2027 buffer := time.Second
2028 timer := time.NewTimer(time.Until(reset) + buffer)
2029 select {
2030 case <-ctx.Done():
2031 if !timer.Stop() {
2032 <-timer.C
2033 }
2034 return ctx.Err()
2035 case <-timer.C:
2036 }
2037 return nil
2038}
2039
2040// When using roundTripWithOptionalFollowRedirect, note that it
2041// is the responsibility of the caller to close the response body.

Callers 2

bareDoMethod · 0.85

Calls 1

StopMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…