NewRetryWatcher creates a new RetryWatcher. It will make sure that watches gets restarted in case of recoverable errors. The initialResourceVersion will be given to watch method when first called.
(initialResourceVersion string, watcherClient cache.Watcher)
| 60 | // It will make sure that watches gets restarted in case of recoverable errors. |
| 61 | // The initialResourceVersion will be given to watch method when first called. |
| 62 | func NewRetryWatcher(initialResourceVersion string, watcherClient cache.Watcher) (*RetryWatcher, error) { |
| 63 | return newRetryWatcher(initialResourceVersion, watcherClient, 1*time.Second) |
| 64 | } |
| 65 | |
| 66 | func newRetryWatcher(initialResourceVersion string, watcherClient cache.Watcher, minRestartDelay time.Duration) (*RetryWatcher, error) { |
| 67 | switch initialResourceVersion { |