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

Function New

pkg/api/api.go:22–36  ·  view source on GitHub ↗
(address string, sdb *sql.DB)

Source from the content-addressed store, hash-verified

20}
21
22func New(address string, sdb *sql.DB) *Api {
23 cache, err := lru.New(256)
24 if err != nil {
25 return nil
26 }
27
28 api := &Api{
29 address: address,
30 cache: cache,
31 db: sdb,
32 }
33 go api.dropCacheLoop()
34
35 return api
36}
37
38func (a *Api) dropCacheLoop() {
39 // Drop the cache every 2 minutes

Callers 1

startAPIFunction · 0.92

Calls 1

dropCacheLoopMethod · 0.95

Tested by

no test coverage detected