1
0
mirror of https://github.com/rancher/steve.git synced 2025-08-19 06:38:02 +00:00

vai: document resync period (#463)

This commit is contained in:
Silvio Moioli 2025-01-28 09:02:38 +01:00 committed by GitHub
parent c1805696ce
commit ae4153b712
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -48,8 +48,15 @@ func NewInformer(client dynamic.ResourceInterface, fields [][]string, transform
example := &unstructured.Unstructured{} example := &unstructured.Unstructured{}
example.SetGroupVersionKind(gvk) example.SetGroupVersionKind(gvk)
// avoids the informer to periodically resync (re-list) its resources // TL;DR: this disables the Informer periodic resync - but this is inconsequential
// currently it is a work hypothesis that, when interacting with the UI, this should not be needed //
// 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) resyncPeriod := time.Duration(0)
sii := newInformer(listWatcher, example, resyncPeriod, cache.Indexers{}) sii := newInformer(listWatcher, example, resyncPeriod, cache.Indexers{})