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

Method Start

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

Source from the content-addressed store, hash-verified

164}
165
166func (w *InMemoryAutoRefresh) Start(ctx context.Context) error {
167 for i := uint(0); i < w.parallelizm; i++ {
168 go func(ctx context.Context) {
169 err := w.sync(ctx)
170 if err != nil {
171 logger.Errorf(ctx, "Failed to sync. Error: %v", err)
172 }
173 }(contextutils.WithGoroutineLabel(ctx, fmt.Sprintf("%v-worker-%v", w.name, i)))
174 }
175
176 enqueueCtx := contextutils.WithGoroutineLabel(ctx, fmt.Sprintf("%v-enqueue", w.name))
177 go w.enqueueLoop(enqueueCtx)
178
179 return nil
180}
181
182func (w *InMemoryAutoRefresh) enqueueLoop(ctx context.Context) {
183 timer := w.clock.NewTimer(w.syncPeriod)

Callers 3

TestCacheFourFunction · 0.95
TestQueueBuildUpFunction · 0.95
TestInProcessingFunction · 0.95

Calls 4

syncMethod · 0.95
enqueueLoopMethod · 0.95
ErrorfFunction · 0.92
WithGoroutineLabelFunction · 0.92

Tested by 3

TestCacheFourFunction · 0.76
TestQueueBuildUpFunction · 0.76
TestInProcessingFunction · 0.76