mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 14:37:00 +00:00
docs: Reflector ListAndWatch
This commit is contained in:
parent
9d23d75071
commit
9a10e95f6e
4
pkg/client/cache/reflector.go
vendored
4
pkg/client/cache/reflector.go
vendored
@ -222,7 +222,9 @@ func (r *Reflector) canForceResyncNow() bool {
|
|||||||
return r.now().Add(forceResyncThreshold).After(r.nextResync)
|
return r.now().Add(forceResyncThreshold).After(r.nextResync)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns error if ListAndWatch didn't even tried to initialize watch.
|
// ListAndWatch first lists all items and get the resource version at the moment of call,
|
||||||
|
// and then use the resource version to watch.
|
||||||
|
// It returns error if ListAndWatch didn't even try to initialize watch.
|
||||||
func (r *Reflector) ListAndWatch(stopCh <-chan struct{}) error {
|
func (r *Reflector) ListAndWatch(stopCh <-chan struct{}) error {
|
||||||
var resourceVersion string
|
var resourceVersion string
|
||||||
resyncCh, cleanup := r.resyncChan()
|
resyncCh, cleanup := r.resyncChan()
|
||||||
|
Loading…
Reference in New Issue
Block a user