MCPcopy
hub / github.com/flyteorg/flyte / enqueueLoop

Method enqueueLoop

flytestdlib/cache/in_memory_auto_refresh.go:182–200  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

180}
181
182func (w *InMemoryAutoRefresh) enqueueLoop(ctx context.Context) {
183 timer := w.clock.NewTimer(w.syncPeriod)
184 defer timer.Stop()
185
186 w.enqueueLoopRunning.Store(true)
187
188 for {
189 select {
190 case <-ctx.Done():
191 return
192 case <-timer.C():
193 err := w.enqueueBatches(ctx)
194 if err != nil {
195 logger.Errorf(ctx, "Failed to enqueue. Error: %v", err)
196 }
197 timer.Reset(w.syncPeriod)
198 }
199 }
200}
201
202// Update updates the item only if it exists in the cache, return true if we updated the item.
203func (w *InMemoryAutoRefresh) Update(id ItemID, item Item) (ok bool) {

Callers 1

StartMethod · 0.95

Calls 5

StopMethod · 0.95
enqueueBatchesMethod · 0.95
ErrorfFunction · 0.92
ResetMethod · 0.65
StoreMethod · 0.45

Tested by

no test coverage detected