MCPcopy Create free account
hub / github.com/RTradeLtd/Lens / flushIfNeeded

Method flushIfNeeded

engine/queue/queue.go:140–151  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

138}
139
140func (q *Queue) flushIfNeeded() {
141 if q.pending >= q.batchSize {
142 q.l.Infow("executing flush", "items", q.pending)
143 var now = time.Now()
144 q.flushFunc(q.pendingItems)
145 q.pending = 0
146 q.pendingItems = make([]*Item, q.batchSize)
147 q.l.Infow("flush complete",
148 "items", q.pending,
149 "duration", time.Since(now))
150 }
151}
152
153func (q *Queue) stop() {
154 q.smux.Lock()

Callers 1

RunMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected