MCPcopy
hub / github.com/nextdns/nextdns / get

Method get

ndp/cache.go:14–25  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12}
13
14func (c *cache) get() Table {
15 now := time.Now().UTC().Unix()
16 last := atomic.LoadInt64(&c.lastUpdate)
17 if now-last > 30 && atomic.SwapInt64(&c.lastUpdate, now) == last {
18 go func() {
19 t, _ := Get()
20 c.table.Store(t)
21 }()
22 }
23 t, _ := c.table.Load().(Table)
24 return t
25}
26
27var global = &cache{}
28

Callers 2

SearchMACFunction · 0.45
SearchIPFunction · 0.45

Calls 1

GetFunction · 0.70

Tested by

no test coverage detected