Commit Graph

4 Commits

Author SHA1 Message Date
Dan Winship
4c5f4cb353 BoundedFrequencyRunner: add RetryAfter 2019-10-29 07:36:00 -04:00
Dan Winship
478fadccff BoundedFrequencyRunner: fix tests
The tests were using a fake timer that only ticked when the test cases
told it to, so it would only be correctly testing the
BoundedFrequencyRunner functionality if the test cases made it tick
whenever the BFR timer was supposed to expire, and didn't make it tick
at any other time. But they didn't do that. Fix it to tick
automatically at the correct times, and update the test cases
accordingly (including adding a new helper method for asserting that
the runner did nothing in cases when it's expected to have done
nothing).

Also fix two unrelated minor bugs in fakeTimer.
2019-10-22 08:17:30 -04:00
Jordan Liggitt
4b9f00988b
Switch from juju/ratelimit to golang.org/x/time/rate 2018-01-19 11:48:52 -05:00
Tim Hockin
bbb80c252b Add bounded frequency runner
This lib manages runs of a function to have min and max frequencies.
2017-05-24 20:33:15 -07:00