The duration from now to the time token needs to be renewed. Needs to be calculated after renewing the token.
()
| 109 | // The duration from now to the time token needs to be renewed. |
| 110 | // Needs to be calculated after renewing the token. |
| 111 | func (t *TokenRenewer) renewDuration() time.Duration { |
| 112 | return t.validUntil.Add(-renewBefore).Sub(time.Now().UTC()) |
| 113 | } |
| 114 | |
| 115 | func (t *TokenRenewer) startRenewLoop() { |
| 116 | // In case when t.client missed a disconnect signal (e.g. due to timeout observed |