MCPcopy
hub / github.com/nextdns/nextdns / Set

Method Set

resolver/bytecache.go:55–65  ·  view source on GitHub ↗
(key uint64, value *cacheValue)

Source from the content-addressed store, hash-verified

53}
54
55func (bc *ByteCache) Set(key uint64, value *cacheValue) {
56 if bc == nil || bc.c == nil || value == nil {
57 return
58 }
59 cost := int64(len(value.msg))
60 if cost <= 0 {
61 cost = 1
62 }
63 // Ristretto's Set is async and may be dropped under contention.
64 _ = bc.c.Set(key, value, cost)
65}
66
67// Metrics returns Ristretto metrics (may be nil if metrics are disabled).
68func (bc *ByteCache) Metrics() *ristretto.Metrics {

Callers

nothing calls this directly

Calls 1

SetMethod · 0.65

Tested by

no test coverage detected