MCPcopy Index your code
hub / github.com/dgraph-io/dgraph / cleanup

Method cleanup

worker/queue.go:276–284  ·  view source on GitHub ↗

cleanup deletes all expired tasks.

()

Source from the content-addressed store, hash-verified

274
275// cleanup deletes all expired tasks.
276func (t *tasks) cleanup() {
277 const taskTtl = 7 * 24 * time.Hour // 1 week
278 minTs := time.Now().UTC().Add(-taskTtl).Unix()
279 minMeta := uint64(minTs) << 32
280
281 t.logMu.Lock()
282 defer t.logMu.Unlock()
283 t.log.DeleteBelow(minMeta)
284}
285
286// newId generates a random unique task ID. logMu must be acquired before calling this function.
287//

Callers 1

workerMethod · 0.95

Calls 3

AddMethod · 0.45
LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected