MCPcopy Create free account
hub / github.com/ethereum/node-crawler / dropCacheLoop

Method dropCacheLoop

pkg/api/api.go:38–49  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

36}
37
38func (a *Api) dropCacheLoop() {
39 // Drop the cache every 2 minutes
40 ticker := time.NewTicker(2 * time.Minute)
41 for range ticker.C {
42 log.Info("Dropping Cache")
43 c, err := lru.New(256)
44 if err != nil {
45 panic(err)
46 }
47 a.cache = c
48 }
49}
50
51func (a *Api) HandleRequests() {
52 router := mux.NewRouter().StrictSlash(true)

Callers 1

NewFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected