MCPcopy Create free account
hub / github.com/cortexproject/cortex / writeBackLoop

Method writeBackLoop

pkg/chunk/cache/background.go:108–124  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

106}
107
108func (c *backgroundCache) writeBackLoop() {
109 defer c.wg.Done()
110
111 for {
112 select {
113 case bgWrite, ok := <-c.bgWrites:
114 if !ok {
115 return
116 }
117 c.queueLength.Sub(float64(len(bgWrite.keys)))
118 c.Cache.Store(context.Background(), bgWrite.keys, bgWrite.bufs)
119
120 case <-c.quit:
121 return
122 }
123 }
124}

Callers 1

NewBackgroundFunction · 0.95

Calls 2

DoneMethod · 0.80
StoreMethod · 0.65

Tested by

no test coverage detected