mirror of
https://github.com/rancher/steve.git
synced 2025-08-19 14:47:36 +00:00
vai: document resync period (#463)
This commit is contained in:
parent
c1805696ce
commit
ae4153b712
@ -48,8 +48,15 @@ func NewInformer(client dynamic.ResourceInterface, fields [][]string, transform
|
||||
example := &unstructured.Unstructured{}
|
||||
example.SetGroupVersionKind(gvk)
|
||||
|
||||
// avoids the informer to periodically resync (re-list) its resources
|
||||
// currently it is a work hypothesis that, when interacting with the UI, this should not be needed
|
||||
// TL;DR: this disables the Informer periodic resync - but this is inconsequential
|
||||
//
|
||||
// Long version: Informers use a Reflector to pull data from a ListWatcher and push it into a DeltaFIFO.
|
||||
// Concurrently, they pop data off the DeltaFIFO to fire registered handlers, and also to keep an updated
|
||||
// copy of the known state of all objects (in an Indexer).
|
||||
// The resync period option here is passed from Informer to Reflector to periodically (re)-push all known
|
||||
// objects to the DeltaFIFO. That causes the periodic (re-)firing all registered handlers.
|
||||
// In this case we are not registering any handlers to this particular informer, so re-syncing is a no-op.
|
||||
// We therefore just disable it right away.
|
||||
resyncPeriod := time.Duration(0)
|
||||
|
||||
sii := newInformer(listWatcher, example, resyncPeriod, cache.Indexers{})
|
||||
|
Loading…
Reference in New Issue
Block a user