Explain weird timer logic

This commit is contained in:
Michael Schurter 2017-04-18 16:36:20 -07:00
parent 4db840b54e
commit 383f21559e

View file

@ -155,6 +155,9 @@ func (c *ServiceClient) Run() {
}
failures++
if !retryTimer.Stop() {
// Timer already expired, since the timer may
// or may not have been read in the select{}
// above, conditionally receive on it
select {
case <-retryTimer.C:
default: